Part Number Hot Search : 
MC74ACT TEF6730A 883409 2N2195B WH045200 03203 PR1MEG D22012P
Product Description
Full Text Search
 

To Download SN250 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  preliminary data this is preliminary information on a new product now in development or undergoing evaluation. details are subject to change without notice. july 2006 rev 1.0 1/130 1 SN250 single-chip zigbee tm /802.15.4 solution features integrated 2.4ghz, ieee 802.15.4-compliant transceiver: ? robust rx filtering allows co-existence with ieee 802.11g and bluetooth devices ? ? 97dbm rx sensitivity (1% per, 20byte packet) ? + 3dbm nominal output power ? increased radio performance mode (boost mode) gives ? 98dbm sensitivity and + 5dbm transmit power ? integrated vco and loop filter integrated ieee 802.15.4 phy and lower mac with dma integrated hardware support for packet trace interface for insight development environment provides integrated rc oscillator for low power operation supports optional 32.768khz crystal oscillator for higher accuracy needs 16-bit xap2b microprocessor integrated memory: ? 128kb of flash ? 5kb of sram configurable memory protection scheme two sleep modes: ? processor idle ? deep sleep?1.0 a (1.5 a with optional 32.768khz oscillator enabled) seventeen gpio pins with alternate functions two serial controllers with dma ?sc1: i 2 c master, spi master, uart ?sc2: i 2 c master, spi master/slave two 16-bit general-purpose timers; one 16-bit sleep timer watchdog timer and power-on-reset circuitry non-intrusive debug interface (sif) integrated aes encryption accelerator integrated adc module first-order, sigma-delta converter with 12-bit resolution integrated 1.8v voltage regulator www.st.com 4 .com u datasheet
contents SN250 2/130 contents 1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 order codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3 pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4 top-level functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.1 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.2 recommended operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.3 environmental characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 5.4 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 5.5 rf electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5.5.1 receive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5.5.2 transmit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.5.3 synthesizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6 functional description?system modules . . . . . . . . . . . . . . . . . . . . . . . . 20 6.1 receive (rx) path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.1.1 rx baseband . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.1.2 rssi and cca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.2 transmit (tx) path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6.2.1 tx baseband . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6.3 integrated mac module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6.4 packet trace interface (pti) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.5 xap2b microprocessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.6 embedded memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.6.1 flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6.6.2 simulated eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6.6.3 flash information area (fia) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.6.4 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.6.5 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4 .com u datasheet
SN250 contents 3/130 6.7 encryption accelerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.8 reset detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 6.9 power-on-reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 6.10 clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 6.10.1 high-frequency crystal oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 6.10.2 low-frequency oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 6.10.3 internal rc oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.11 random number generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.12 watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.13 sleep timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 6.14 power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 7 functional description?application modules . . . . . . . . . . . . . . . . . . . . . 31 7.1 gpio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7.1.1 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 7.2 serial controller sc1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 7.2.1 uart mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 7.2.2 spi master mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 7.2.3 i2c master mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 7.2.4 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 7.3 serial controller sc2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 7.3.1 spi modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 7.3.2 i2c master mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 7.3.3 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 7.4 general purpose timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 7.4.1 clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 7.4.2 timer functionality (counting) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 7.4.3 timer functionality (output compare) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 7.4.4 timer functionality (input capture) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.4.5 timer interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.4.6 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 7.5 adc module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 7.5.1 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 7.6 event manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 7.6.1 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 4 .com u datasheet
contents SN250 4/130 7.7 integrated voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 8 sif module programming and debug interface . . . . . . . . . . . . . . . . . . . 118 9 typical application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 10 mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 11 register address table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 12 abbreviations and acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 13 references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 14 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 4 .com u datasheet
SN250 general description 5/130 1 general description the SN250 is a single-chip solution that integrates a 2.4ghz, ieee 802.15.4-compliant transceiver with a 16-bit xap2b microprocessor. it contains integrated flash and ram memory and peripherals of use to designers of zigbee-based applications. the transceiver utilizes an efficient architecture that exceeds the dynamic range requirements imposed by the ieee 802.15.4-2003 standard by over 15db. the integrated receive channel filtering allows for co-existence with other communication standards in the 2.4ghz spectrum such as ieee 802.11g and bluetooth. the integrated regulator, vco, loop filter, and power amplifier keep the external component count low. an optional high performance radio mode (boost mode) is software selectable to boost dynamic range by a further 3db. the xap2b microprocessor is a power-optimized core integrated in the SN250. it supports two different modes of operation?system mode and application mode. the znet stack runs in system mode with full access to all areas of the chip. application code runs in application mode with limited access to the SN250 resources; this allows for the scheduling of events by the application developer while preventing modification of restricted areas of memory and registers. this architecture results in increased stability and reliability of deployed solutions. the SN250 has 128kb of embedded flash memory and 5kb of integrated ram for data and program storage. the SN250 software stack employs an effective wear-leveling algorithm in order to optimize the lifetime of the embedded flash. to maintain the strict timing requirements imposed by zigbee and the ieee 802.15.4-2003 standard, the SN250 integrates a number of mac functions into the hardware. the mac hardware handles automatic ack transmission and reception, automatic backoff delay, and clear channel assessment for transmission, as well as automatic filtering of received packets. in addition, the SN250 allows for true mac level debugging by integrating the packet trace interface. to support user-defined applications, a number of peripherals such as gpio, uart, spi, i 2 c, adc, and general-purpose timers are integrated. also, an integrated voltage regulator, power-on-reset circuitry, sleep timer, and low-power sleep modes are available. the deep sleep mode draws less than 1 a, allowing products to achieve long battery life. finally, the SN250 utilizes the non-intrusive sif module for powerful software debugging and programming of the xap2b microcontroller. target applications for the SN250 include: building automation and control home automation and control home entertainment control asset tracking the SN250 is purchased with znet, a zigbee-compliant software stack codeveloped by ember corporation and stmicroelectronics, providing a zigbee profile-ready, platform- compliant solution.this technical datasheet details the SN250 features available to customers using it with the znet stack. 4 .com u datasheet
order codes SN250 6/130 2 order codes 3 pin assignment figure 1. SN250 pin assignment refer to table 17 and table 18 for selecting alternate pin functions. part number temperature range package packing marking SN250q -40 to +85c qfn48 tray SN250 SN250qt -40 to +85c qfn48 tape & reel SN250 4 .com u datasheet
SN250 pin assignment 7/130 table 1. pin descriptions pin # signal direction description 1 vdd_24mhz power 1.8v high-frequency oscillator supply 2 vdd_vco power 1.8v vco supply 3 rf_p i/o differential (with rf_n) receiver input/transmitter output 4 rf_n i/o differential (with rf_p) receiver input/transmitter output 5 vdd_rf power 1.8v rf supply (lna and pa) 6 rf_tx_alt_p o differential (with rf_tx_alt_n) transmitter output (optional) 7 rf_tx_alt_n o differential (with rf_tx_alt_p) transmitter output (optional) 8 vdd_if power 1.8v if supply (mixers and filters) 9 bias_r i bias setting resistor 10 vdd_padsa power analog pad supply (1.8v) 11 tx_active o logic-level control for external rx/tx switch 12 vdd_padsa power analog pad supply (1.8v) 13 rstb i active low chip reset (internal pull-up) 14 osc32b i/o 32.768khz crystal oscillator or left open when using external clock on osc32a 15 osc32a i/o 32.768khz crystal oscillator or digital clock input 16 vreg_out power regulator output (1.8v) 17 vdd_pads power pads supply (2.1?3.6v) 18 vdd_core power 1.8v digital core supply 19 gpio11 i/o digital i/o (enable gpio11 with gpio_cfg[7:4] ) cts i uart cts handshake of serial controller sc1 (enable sc1-4a with gpio_cfg[7:4] , select uart with sc1_mode ) mclk o spi master clock of serial controller sc1 (enable sc1-3m with gpio_cfg[7:4] , select spi with sc1_mode , enable master with sc1_spicfg[4] ) tmr2ia.1 i capture input a of timer 2 (enable cap2-0 with gpio_cfg[7:4] ) 20 gpio12 i/o digital i/o (enable gpio12 with gpio_cfg[7:4] ) rts o uart rts handshake of serial controller sc1 (enable sc1-4a with gpio_cfg[7:4] , select uart with sc1_mode ) tmr2ib.1 i capture input b for timer 2 (enable cap2-0 with gpio_cfg[7:4] ) 4 .com u datasheet
pin assignment SN250 8/130 21 gpio0 i/o digital i/o (enable gpio0 with gpio_cfg[7:4] ) mosi o spi master data out of serial controller sc2 (enable sc2-3m with gpio_cfg[7:4] , select spi with sc2_mode , enable master with sc2_spicfg[4] ) mosi i spi slave data in of serial controller sc2 (enable sc2-4s with gpio_cfg[7:4] , select spi with sc2_mode , enable slave with sc2_spicfg[4] ) tmr1ia.1 i capture input a of timer 1 (enable cap1-0 with gpio_cfg[7:4] ) 22 gpio1 i/o digital i/o (enable gpio1 with gpio_cfg[7:4] ) miso i spi master data in of serial controller sc2 (enable sc2-3m with gpio_cfg[7:4] , select spi with sc2_mode , enable master with sc2_spicfg[4] ) miso o spi slave data out of serial controller sc2 (enable sc2-4s with gpio_cfg[7:4] , select spi with sc2_mode , enable slave with sc2_spicfg[4] ) sda i/o i 2 c data of serial controller sc2 (enable sc2-2 with gpio_cfg[7:4] , select i 2 c with sc2_mode ) tmr2ia.2 i capture input a of timer 2 (enable cap2-1 with gpio_cfg[7:4] ) 23 vdd_pads power pads supply (2.1?3.6v) 24 gpio2 i/o digital i/o (enable gpio2 with gpio_cfg[7:4] ) msclk o spi master clock of serial controller sc2 (enable sc2-3m with gpio_cfg[7:4] , select spi with sc2_mode , enable master with sc2_spicfg[4] ) msclk i spi slave clock of serial controller sc2 (enable sc2-4s with gpio_cfg[7:4] , select spi with sc2_mode , enable slave with sc2_spicfg[4] ) scl i/o i 2 c clock of serial controller sc2 (enable sc2-2 with gpio_cfg[7:4] , select i 2 c with sc2_mode ) tmr2ib.2 i capture input b of timer 2 (enable cap2-1 with gpio_cfg[7:4] ) table 1. pin descriptions (continued) pin # signal direction description 4 .com u datasheet
SN250 pin assignment 9/130 25 gpio3 i/o digital i/o (enable gpio3 with gpio_cfg[7:4] ) ssel i spi slave select of serial controller sc2 (enable sc2-4s with gpio_cfg[7:4] , select spi with sc2_mode , enable slave with sc2_spicfg[4] ) tmr1ib.1 i capture input b of timer 1 (enable cap1-0 with gpio_cfg[7:4] ) 26 gpio4 i/o digital i/o (enable gpio4 with gpio_cfg[12] and gpio_cfg[8] ) adc0 analog adc input 0 (enable adc0 with gpio_cfg[12] and gpio_cfg[8] ) pti_en o frame signal of packet trace interface (pti) (enable pti with gpio_cfg[12] ) 27 gpio5 i/o digital i/o (enable gpio5 with gpio_cfg[12] and gpio_cfg[9] ) adc1 analog adc input 1 (enable adc1 with gpio_cfg[12] and gpio_cfg[9] ) pti_data o data signal of packet trace interface (pti) (enable pti with gpio_cfg[12] ) 28 vdd_pads power pads supply (2.1?3.6v) 29 gpio6 i/o digital i/o (enable gpio6 with gpio_cfg[10] ) adc2 analog adc input 2 (enable adc2 with gpio_cfg[10] ) tmr2clk i external clock input of timer 2 tmr1enmsk i external enable mask of timer 1 30 gpio7 i/o digital i/o (enable gpio7 with gpio_cfg[13] and gpio_cfg[11] ) adc3 analog adc input 3 (enable adc3 with gpio_cfg[13] and gpio_cfg[11] ) reg_en o external regulator open collector output (enable reg_en with gpio_cfg[13] ) 31 gpio8 i/o digital i/o (enable gpio8 with gpio_cfg[14] ) vref_out analog adc reference output (enable vref_out with gpio_cfg[14] ) tmr1clk i external clock input of timer 1 tmr2enmsk i external enable mask of timer 2 irqa i external interrupt source a table 1. pin descriptions (continued) pin # signal direction description 4 .com u datasheet
pin assignment SN250 10/130 32 gpio9 i/o digital i/o (enable gpio9 with gpio_cfg[7:4] ) txd o uart transmit data of serial controller sc1 (enable sc1-4a or sc1-2 with gpio_cfg[7:4] , select uart with sc1_mode ) mo o spi master data out of serial controller sc1 (enable sc1-3m with gpio_cfg[7:4] , select spi with sc1_mode , enable master with sc1_spicfg[4] ) msda i/o i 2 c data of serial controller sc1 (enable sc1-2 with gpio_cfg[7:4] , select i 2 c with sc1_mode ) tmr1ia.2 i capture input a of timer 1 (enable cap1-1 or cap1-1h with gpio_cfg[7:4] ) 33 gpio10 i/o digital i/o (enable gpio10 with gpio_cfg[7:4] ) rxd i uart receive data of serial controller sc1 (enable sc1-4a or sc1-2 with gpio_cfg[7:4] , select uart with sc1_mode ) mi i spi master data in of serial controller sc1 (enable sc1-3m with gpio_cfg[7:4] , select spi with sc1_mode , enable master with sc1_spicfg[4] ) mscl i/o i 2 c clock of serial controller sc1 (enable sc1-2 with gpio_cfg[7:4] , select i 2 c with sc1_mode ) tmr1ib.2 i capture input b of timer 2 (enable cap1-1 with gpio_cfg[7:4] ) 34 sif_clk i serial interface, clock (internal pull-down) 35 sif_miso o serial interface, master in/slave out 36 sif_mosi i serial interface, master out/slave in 37 sif_loadb i/o serial interface, load strobe (open-collector with internal pull-up) 38 gnd power ground supply 39 vdd_flash power 1.8v flash memory supply 40 gpio16 i/o digital i/o (enable gpio16 with gpio_cfg[3] ) tmr1ob o waveform output b of timer 1 (enable tmr1ob with gpio_cfg[3] ) tmr2ib.3 i capture input b of timer 2 (enable cap2-2 with gpio_cfg[7:4] ) irqd i external interrupt source d table 1. pin descriptions (continued) pin # signal direction description 4 .com u datasheet
SN250 pin assignment 11/130 41 gpio15 i/o digital i/o (enable gpio15 with gpio_cfg[2] ) tmr1oa o waveform output a of timer 1 (enable tmr1oa with gpio_cfg[2] ) tmr2ia.3 i capture input a of timer 2 (enable cap2-2 with gpio_cfg[7:4] ) irqc i external interrupt source c 42 gpio14 i/o digital i/o (enable gpio14 with gpio_cfg[1] ) tmr2ob o waveform output b of timer 2 (enable tmr2ob with gpio_cfg[1] ) tmr1ib.3 i capture input b of timer 1 (enable cap1-2 with gpio_cfg[7:4] ) irqb i external interrupt source b 43 gpio13 i/o digital i/o (enable gpio13 with gpio_cfg[0] ) tmr2oa o waveform output a of timer 2 (enable tmr2oa with gpio_cfg[0] ) tmr1ia.3 i capture input a of timer 1 (enable cap1-2 or cap1-2h with gpio_cfg[7:4] ) 44 vdd_core power 1.8v digital core supply 45 vdd_pre power 1.8v prescaler supply 46 vdd_synth power 1.8v synthesizer supply 47 oscb i/o 24mhz crystal oscillator or left open when using external clock input on osca 48 osca i/o 24mhz crystal oscillator or external clock input 49 gnd ground ground supply pad in the bottom center of the package forms pin 49 (see the SN250 reference design for pcb considerations) table 1. pin descriptions (continued) pin # signal direction description 4 .com u datasheet
top-level functional description SN250 12/130 4 top-level functional description figure 2 shows a detailed block diagram of the SN250. figure 2. SN250 block diagram the radio receiver is a low-if, super-heterodyne receiver. it utilizes differential signal paths to minimize noise interference, and its architecture has been chosen to optimize co- existence with other devices within the 2.4ghz band (namely, i eee 802.11g and bluetooth). after amplification and mixing, the signal is filtered and combined prior to being sampled by an adc. the digital receiver implements a coherent demodulator to generate a chip stream for the hardware-based mac. in addition, the digital rece iver contains the analog radio calibration routines and control of the gain within the receiver path. the radio transmitter utilizes an efficient architecture in which the data stream directly modulates the vco. an integrated pa boosts the output power. the calibration of the tx path as well as the output power is controlled by digital logic. the integrated 4.8 ghz vco and loop filter minimize off-chip circuitry. only a 24mhz crystal with its loading capacitors is required to properly establish the pll reference signal. the mac interfaces the data memory to the rx and tx baseband modules. the mac provides hardware-based ieee 802.15.4 packet-level filtering. it supplies an accurate symbol time base that minimizes the synchronization effort of the software stack and meets the protocol timing requirements. in addition, it provides timer and synchronization assistance for the ieee 802.15.4 csma-ca algorithm. 4 .com u datasheet
SN250 top-level functional description 13/130 the SN250 integrates hardware support for a packet trace module, which allows robust packet-based debug. this element is a critical component of insight desktop, the software ide codeveloped by st and ember, providing advanced network debug capability when coupled with the insight adapter. the SN250 integrates a 16-bit xap2b microprocessor developed by cambridge consultants ltd. this power-efficient, industry-proven core provides the appropriate level of processing power to meet the needs of zigbee applications. in addition, 128kb of flash and 5kb of sram comprise the program and data memory elements, respectively. the SN250 employs a configurable memory protection scheme usually found on larger microcontrollers. in addition, the sif module provides a non-intrusive programming and debug interface allowing for real-time application debugging. the SN250 contains 17 gpio pins shared with other peripheral (or alternate) functions. flexible routing within the SN250 lets external devices utilize the alternate functions on a variety of different gpios. the integrated serial controller sc1 can be configured for spi (master-only), i 2 c (master-only), or uart functionality, and the serial controller sc2 can be configured for spi (master or slave) or i 2 c (master-only) operation. the SN250 has an adc integrated which can sample analog signals from four gpio pins single-ended or differentially. in addition, the unregulated voltage supply vdd_pads, regulated supply vdd_padsa, voltage reference vref, and gnd can be sampled. the integrated voltage reference vref for the adc can be made available to external circuitry. the integrated voltage regulator generates a regulated 1.8v reference voltage from an unregulated supply voltage. this voltage is decoupled and routed externally to supply the 1.8v to the core logic. in addition, an integrated por module allows for the proper cold start of the SN250. the SN250 contains one high-frequency (24mhz) crystal oscillator and, for low-power operation, a second low-frequency oscillator (either an internal 10khz rc oscillator or an external 32.768khz crystal oscillator). the SN250 contains two power domains. the always-powered high voltage supply is used for powering the gpio pads and critical chip functions. the rest of the chip is powered by a regulated low voltage supply which can be disabled during deep sleep to reduce the power consumption. 4 .com u datasheet
electrical characteristics SN250 14/130 5 electrical characteristics 5.1 absolute maximum ratings table 2 lists the absolute maximum ratings for the SN250. 5.2 recommended operating conditions table 3 lists the rated operating conditions of the SN250. . table 2. absolute maximum ratings parameter test conditions min. max. unit regulator voltage (vdd_pads) ? 0.3 3.6 v core voltage (vdd_24mhz, vdd_vco, vdd_rf, vdd_if, vdd_padsa, vdd_flash, vdd_pre, vdd_synth, vdd_core) ? 0.3 2.0 v voltage on rf_p,n; rf_tx_alt_p,n ? 0.3 3.6 v voltage on any gpio[16:0], sif_clk, sif_miso, sif_mosi, sif_loadb, osc32a, osc32b, rstb, vreg_out ? 0.3 vdd_pads + 0.3 v voltage on tx_active, bias_r, osca, oscb ? 0.3 vdd_core + 0.3 v storage temperature ? 40 + 140 c table 3. operating conditions parameter test conditions min. typ. max. unit regulator input voltage (vdd_pads) 2.1 3.6 v core input voltage (vdd_24mhz, vdd_vco, vdd_rf, vdd_if, vdd_padsa, vdd_flash, vdd_pre, vdd_synth, vdd_core) 1.7 1.8 1.9 v temperature range -40 + 85 c 4 .com u datasheet
SN250 electrical characteristics 15/130 5.3 environmental characteristics table 4 lists the environmental characteristics of the SN250. 5.4 dc electrical characteristics table 5 lists the dc electrical characteristics of the SN250. table 4. environmental characteristics parameter test conditions min. typ. max. unit esd (human body model) on any pin ? 2 + 2kv esd (charged device model) non-rf pins ? 400 + 400 v esd (charged device model) rf pins ? 225 + 225 v moisture sensitivity level (msl1) tbd table 5. dc characteristics parameter test conditions min. typ. max. unit regulator input voltage (vdd_pads) 2.1 3.6 v power supply range (vdd_core) regulator output or external input 1.7 1.8 1.9 v deep sleep current quiescent current, including internal rc oscillator at 25 c. 1.0 a quiescent current, including 32.768khz oscillator at 25 c. 1.5 a rx current radio receiver, mac, and baseband (boost mode) 29.0 ma radio receiver, mac, and baseband 27.0 ma cpu, ram, and flash memory at 25 c and 1.8v core 8.5 ma total rx current ( = i radio receiver, mac and baseband, cpu + i ram, and flash memory ) at 25 c, vdd_pads=3.0v 35.5 ma tx current radio transmitter, mac, and baseband (boost mode) at max. tx power ( + 5dbm typical) 33.0 ma 4 .com u datasheet
electrical characteristics SN250 16/130 table 6 contains the digital i/o specifications for the SN250. the digital i/o power (named vdd_pads) comes from three dedicated pins (pins 17, 23, and 28). the voltage applied to these pins sets the i/o voltage. radio transmitter, mac, and baseband at max. tx power ( + 3dbm typical) 27.0 ma at 0 dbm typical 24.3 ma at min. tx power ( ? 32dbm typical) 19.5 ma cpu, ram, and flash memory at 25 c, vdd_pads = 3.0v 8.5 ma total tx current ( = i radio transmitter, mac and baseband, cpu + i ram, and flash memory ) at 25 c and 1.8v core; max. power out 35.5 ma table 6. digital i/o specifications parameter name min. typ. max. unit voltage supply vdd_pad s 2.1 3.6 v input voltage for logic 0 v il 0 0.2 x vdd_pads v input voltage for logic 1 v ih 0.8 x vdd_pads vdd_pads v input current for logic 0 i il ? 0.5 a input current for logic 1 i ih 0.5 a input pull-up resistor value r ipu 30 k input pull-down resistor value r ipd 30 k output voltage for logic 0 v ol 0 0.18 x vdd_pads v output voltage for logic 1 v oh 0.82 x vdd_pads vdd_pads v output source current (standard current pad) i ohs 4ma output sink current (standard current pad) i ols 4ma output source current (high current pad: gpio[16:13]) i ohh 8ma output sink current (high current pad: gpio[16:13]) i olh 8ma total output current (for i/o pads) i oh + i ol 40 ma input voltage threshold for osc32a 0.2 0.8 ? vdd_pads v table 5. dc characteristics (continued) parameter test conditions min. typ. max. unit 4 .com u datasheet
SN250 electrical characteristics 17/130 input voltage threshold for osca 0.2 0.8 ? vdd_core output voltage level (tx_active) 0.18 ? vdd_cor e 0.82 ? vdd_core v table 6. digital i/o specifications parameter name min. typ. max. unit 4 .com u datasheet
electrical characteristics SN250 18/130 5.5 rf electrical characteristics 5.5.1 receive table 7 lists the key parameters of the integrated ieee 802.15.4 receiver on the SN250. . table 7. receive characteristics parameter test conditions min. typ. max. unit frequency range 2400 2500 mhz sensitivity (boost mode) 1% per, 20byte packet defined by ieee 802.15.4 ? 93 ? 98 dbm sensitivity 1% per, 20byte packet defined by ieee 802.15.4 ? 92 ? 97 dbm high-side adjacent channel rejection ieee 802.15.4 signal at ? 82dbm 35 db low-side adjacent channel rejection ieee 802.15.4 signal at ? 82dbm 35 db 2nd high-side adjacent channel rejection ieee 802.15.4 signal at ? 82dbm 40 db 2nd low-side adjacent channel rejection ieee 802.15.4 signal at ? 82dbm 40 db channel rejection for all other channels ieee 802.15.4 signal at ? 82dbm 40 db 802.11g rejection centered at + 12mhz or ? 13mhz ieee 802.15.4 signal at ? 82dbm 40 db maximum input signal level for correct operation (low gain) 0dbm image suppression 30 db co-channel rejection ieee 802.15.4 signal at ? 82dbm ? 6dbc relative frequency error (2x40 ppm required by ieee 802.15.4) ? 120 + 120 ppm relative timing error (2x40 ppm required by ieee 802.15.4) ? 120 + 120 ppm linear rssi range 40 db 4 .com u datasheet
SN250 electrical characteristics 19/130 5.5.2 transmit table 8 lists the key parameters of the integrated ieee 802.15.4 transmitter on the SN250. 5.5.3 synthesizer table 9 lists the key parameters of the integrated synthesizer on the SN250. table 8. transmit characteristics parameter test conditions min. typ. max. unit maximum output power (boost mode) at highest power setting 5 dbm maximum output power at highest power setting 0 3 dbm minimum output power at lowest power setting ? 32 dbm error vector magnitude as defined by ieee 802.15.4, which sets a 35% maximum 15 25 % carrier frequency error ? 40 + 40 ppm load impedance 200 psd mask relative 3.5mhz away ? 20 db psd mask absolute 3.5mhz away ? 30 dbm table 9. synthesizer characteristics parameter test conditions min. typ. max. unit frequency range 2400 2500 mhz frequency resolution 11.7 khz lock time from off, with correct vco dac setting 100 s relock time channel change or rx/tx turnaround (ieee 802.15.4 defines 192 s turnaround time) 100 s phase noise at 100khz ? 71 dbc/hz phase noise at 1mhz ? 91 dbc/hz phase noise at 4mhz ? 103 dbc/hz phase noise at 10mhz ? 111 dbc/hz 4 .com u datasheet
functional description?system modules SN250 20/130 6 functional description?system modules the SN250 contains a dual-thread mode of operation?system mode and application mode?to guarantee microcontroller bandwidth to the application developer and protect the developer from errant software access. during system mode, all areas including the rf transceiver, mac, packet trace interface, sleep timer, power management module, watchdog timer, and power on reset module are accessible. since the SN250 comes with a license to znet, a zigbee-compliant software stack codeveloped by ember corporation and stmicroelectronics, these areas are not available to the application developer in application mode. the following brief description of these modules provides the necessary background on the operation of the SN250. for more information, please contact your nearest stmicroelectronics sales office. 6.1 receive (rx) path the SN250 rx path spans the analog and digital domains. the rx architecture is based on a low-if, super-heterodyne receiver. it utilizes differential signal paths to minimize noise interference. the input rf signal is mixed down to the if frequency of 4mhz by i and q mixers. the output of the mixers is filtered and combined prior to being sampled by a 12msps adc. the rx filtering within the rx path has been designed to optimize the co- existence of the SN250 with other 2.4ghz transceivers, such as the i eee 802.11g and bluetooth. 6.1.1 rx baseband the SN250 rx baseband (within the digital domain) implements a coherent demodulator for optimal performance. the baseband demodulates the o-qpsk signal at the chip level and synchronizes with the ieee 802.15.4-2003 preamble. once a packet preamble is detected, it de-spreads the demodulated data into 4-bit symbols. these symbols are buffered and passed to the hardware-based mac module for filtering. in addition, the rx baseband provides the calibration and control interface to the analog rx modules, including the lna, rx baseband filter, and modulation modules. the znet software includes calibration algorithms which use this interface to reduce the effects of process and temperature variation. 6.1.2 rssi and cca the SN250 calculates the rssi over an 8-symbol period as well as at the end of a received packet. it utilizes the rx gain settings and the output level of the adc within its algorithm. the SN250 rx baseband provides support for the i eee 802.15.4-2003 required cca methods summarized in table 10 . modes 1, 2, and 3 are defined by the 802.15.4-2003 standard; mode 0 is a proprietary mode. 4 .com u datasheet
SN250 functional description?system modules 21/130 6.2 transmit (tx) path the SN250 transmitter utilizes both analog circuitry and digital logic to produce the o-q psk modulated signal. the area-efficient tx architecture directly modulates the spread symbols prior to transmission. the differential signal paths increase noise immunity and provide a common interface for the external balun. 6.2.1 tx baseband the SN250 tx baseband (within the digital domain) performs the spreading of the 4-bit symbol into its ieee 802.15.4-2003-defi ned 32-chip i and q sequence. in addition, it provides the interface for software to perform the calibration of the tx module in order to reduce process, temperature, and voltage variations. 6.3 integrated mac module the SN250 integrates critical portions of the ieee 802.15.4-2003 mac requirements in hardware. this allows the microcontroller to provide greater bandwidth to application and network operations. in addition, the hardware acts as a first-line filter for non-intended packets. the SN250 mac utilizes a dma interface to ram memory to further reduce the overall microcontroller interaction when transmitting or receiving packets. when a packet is ready for transmission, the software configures the tx mac dma by indicating the packet buffer ram location. the mac waits for the backoff period, then transitions the baseband to tx mode and performs channel assessment. when the channel is clear, the mac reads data from the ram buffer, calculates the crc, and provides 4-bit symbols to the baseband. when the final byte has been read and sent to the baseband, the crc remainder is read and transmitted. the mac resides in rx mode most of the time, and different format and address filters keep non-intended packets from using excessive ram buffers, as well as preventing the cpu from being interrupted. when the reception of a packet begins, the mac reads 4-bit symbols from the baseband and calculates the crc. it assembles the received data for storage in a ram buffer. a rx mac dma provides direct access to the ram memory. once the packet has been received, additional data is appended to the end of the packet in the ram buffer space. the appended data provides statistical information on the packet for the software stack. table 10. cca mode behavior cca mode mode behavior 0 clear channel reports busy medium if either carrier sense or rssi exceeds their thresholds. 1 clear channel reports busy medium if rssi exceeds its threshold. 2 clear channel reports busy medium if carrier sense exceeds its threshold. 3 clear channel reports busy medium if both rssi and carrier sense exceed their thresholds. 4 .com u datasheet
functional description?system modules SN250 22/130 the primary features of the mac are: crc generation, appending, and checking hardware timers and interrupts to achieve the mac symbol timing automatic preamble, and sfd pre-pended to a tx packet address recognition and packet filtering on received packets automatic acknowledgement transmission automatic transmission of packets from memory automatic transmission after backoff time if channel is clear (cca) automatic acknowledgement checking time stamping of received and transmitted messages attaching packet information to received packets (lqi, rssi, gain, time stamp, and packet status) ieee 802.15.4 timing and slotted/unslotted timing 6.4 packet trace interface (pti) the SN250 integrates a true phy-level pti for effective network-level debugging. this two- signal interface monitors all the phy tx and rx packets (in a non-intrusive manner) between the mac and baseband modules. it is an asynchronous 500kbps interface and cannot be used to inject packets into the phy/mac interface. the two signals from the SN250 are the frame signal (pti_en) and the data signal (pti_data). the pti is supported by insight desktop. 6.5 xap2b microprocessor the SN250 integrates the xap2b microprocessor developed by cambridge consultants ltd., making it a true system-on-a-chip solution. the xap2b is a 16-bit harvard architecture processor with separate program and data address spaces. the word width is 16 bits for both the program and data sides. data-side addresses are always specified in bytes, though they can be accessed as either bytes or words, while program-side addresses are always specified and accessed as words. the data-side address bus is effectively 15 bits wide, allowing for an address space of 32kb; the program-side address bus is 16 bits wide, addressing 64k words. the standard xap2 microprocessor and accompanying software tools have been enhanced to create the xap2b microprocessor used in the SN250. the xap2b adds data-side byte addressing support to the xap2 by utilizing the 15th bit of the data-side address bus to indicate byte or word accesses. this allows for more productive usage of ram, optimized code, and a more familiar arch itecture for customers when compared to the standard xap2. the xap2b clock speed is 12mhz. when used with the znet stack, code is loaded into flash memory over the air or by a serial link using a built-in bootloader in a reserved area of the flash. alternatively, code may be loaded via the sif interface with the assistance of ram-based utility routines also loaded via sif. the xap2b in the SN250 has also been enhanced to support two separate protection levels. the znet stack runs in system mode, which allows full, unrestricted access to all areas of the chip, while application code runs in application mode. when running in application mode, writing to certain areas of memory and registers is restricted to prevent 4 .com u datasheet
SN250 functional description?system modules 23/130 common software bugs from interfering with the operation of the znet stack. these errant writes are captured and details are reported to the developer to assist in tracking down and fixing these issues. 6.6 embedded memory as shown in figure 3 , the program side of the address space contains mappings to both integrated flash and ram blocks. figure 3. program address space the data side of the address space contains mappings to the same flash and ram blocks, as well as registers and a separate flash information area, as shown in figure 4 . 4 .com u datasheet
functional description?system modules SN250 24/130 figure 4. data address space 6.6.1 flash memory the SN250 integrates 128kb of flash memory. the flash cell has been qualified for a data retention time of >100 years at room temperature. each flash page size is 1024 bytes and is rated to have a guaranteed 1,000 write/erase cycles. the flash memory has mappings to both the program and data side address spaces. on the program side, the first 112kb of the flash memory are mapped to the corresponding first 56k word addresses to allow for code storage, as shown in figure 3 . on the program side, the flash is always read as whole words. on the data side, the flash memory is divided into eight 16kb sections, which can be separately mapped into a flash window for the storage of constant data and the simulated eeprom. as shown in figure 4 , the flash window corresponds to the first 16kb of the data-side address space. on the data side, the flash may be read as bytes, but can only be written to one word at a time using utility routines in the znet stack and hal. 6.6.2 simulated eeprom the znet stack reserves a section of flash memory to provide simulated eeprom stor age area for stack and customer tokens. therefore, the SN250 utilizes 8kb of upper flash storage. this section of flash is only accessible when mapped to the flash window in the data-side address space. because the flash cells are qualified for up to 1,000 write cycles, 4 .com u datasheet
SN250 functional description?system modules 25/130 the simulated eeprom implements an effective wear-leveling algorithm which effectively extends the number of write cycles for individual tokens. 6.6.3 flash information area (fia) the SN250 also includes a separate 1024-byte fia that can be used for storage of data during manufacturing, including serial numbers and calibration values. this area is mapped to the data side of the address space, starting at address 0x5000. while this area can be read as individual bytes, it can only be written to one word at a time, and may only be erased as a whole. programming of this special flash page can only be enabled using the sif interface to prevent accidental corruption or erasure. the znet stack reserves a small portion of this space for its own use, but the rest is available to the application. 6.6.4 ram the SN250 integrates 5kb of sram. like the flash memory, this ram is also mapped to both the program and data-side address spaces. on the program side, the ram is mapped to the top 2.5k words of the program address space. the program-side mapping of the ram is used for code when writing to or erasing the flash memory. on the data side, the ram is also mapped to the top of the address space, occupying the last 5kb, as shown in figure 3 and figure 4 . additionally, the SN250 supports a protection mechanism to prevent application code from overwriting system data stored in the ram. to enable this, the ram is segmented into 32- byte sections, each with a configurable bit that allows or denies write access when the SN250 is running in application mode. read access is always allowed to the entire ram, and full access is always allowed when the SN250 is running in system mode. the znet stack intelligently manages this protection mechanism to assist in tracking down many common application errors. 6.6.5 registers table 40 provides a short description of all application-accessible registers within the SN250. complete descriptions are provided at the end of each applicable functional description section. the registers are mapped to the data-side address space starting at address 0x4000. these registers allow for the control and configuration of the various peripherals and modules. the registers may only be accessed as whole word quantities; attempts to access them as bytes may result in undefined behavior. there are additional registers used by the znet stack when the SN250 is running in system mode, allowing for control of the mac, baseband, and other inte rnal modules. these system registers are protected from being modified when the SN250 is running in application mode. 6.7 encryption accelerator the SN250 contains a hardware aes encryption engine that is attached to the cpu using a memory-mapped interface. nist-based ccm, ccm*, cbc-mac, and ctr modes are implemented in hardware. these modes are described in the ieee 802.15.4-2003 specification, with the exception of ccm*, which is described in the zigbee security services specification 1.0. the znet stack implements a security api for applications that require security at the application level. 4 .com u datasheet
functional description?system modules SN250 26/130 6.8 reset detection the SN250 contains multiple reset sources. the reset event is logged into the reset source register, which lets the cpu determine the cause of the last reset. the following reset causes are detected: power-on-reset watchdog pc rollover software reset core power dip 6.9 power-on-reset (por) each voltage domain (1.8v digital core supply vdd_core and pads supply vdd_pads) has a power-on-reset (por) cell. the vdd_pads por cell holds the always-powered high-voltage domain in reset until the following conditions have been met: the high-voltage pads supply vdd_pads voltage rises above a threshold. the internal rc clock starts and generates three clock pulses. the 1.8v por cell holds the main digital core in reset until the regulator output voltage rises above a threshold. additionally, the digital domain counts 1,024 clock edges on the 24mhz crystal before releasing the reset to the main digital core. table 11 lists the features of the SN250 por circuitry. 6.10 clock sources the SN250 integrates three oscillators: a high-frequency 24mhz crystal oscillator, an optional low-frequency 32.768khz crystal oscillator, and a low-frequency internal 10khz rc oscillator. 6.10.1 high-frequency crystal oscillator the integrated high-frequency crystal oscillator requires an external 24mhz crystal with an accuracy of 40ppm. based upon the application bill of materials and current consumption requirements, the external crystal can cover a range of esr requirements. for a lower esr, the cost of the crystal increases but the overall current consumption decreases. likewise, table 11. por specifications parameter min. typ. max. unit vdd_pads por release 1.0 1.2 1.4 v vdd_pads por assert 0.5 0.6 0.7 v 1.8v por release 1.35 1.5 1.65 v 1.8v por hysteresis 0.08 0.1 0.12 v 4 .com u datasheet
SN250 functional description?system modules 27/130 for higher esr, the cost decreases but the current consumption increases. therefore, the designer can choose a crystal to fit the needs of the application. table 12 lists the specifications for the high-frequency crystal. 6.10.2 low-frequency oscillator the optional low-frequency crystal source for the SN250 is a 32.768khz crystal. table 13 lists the requirements for the low-frequency crystal. the low-frequency crystal may be used for applications that require greater accuracy than can be provided by the internal rc oscillator. the crystal oscillator has been des igned to accept any standard watch crystal with an esr of 100 k . table 12. high-frequency crystal specifications parameter test conditions min. typ. max. unit frequency 24 mhz duty cycle 40 60 % phase noise from 1khz to 100khz ? 120 dbc/hz accuracy initial, temperature, and aging ? 40 + 40 ppm crystal esr load capacitance of 10pf 100 crystal esr load capacitance of 18pf 60 start-up time to stable clock (max. bias) 1ms start-up time to stable clock (optimum bias) 2ms current consumption good crystal: 20 esr, 10pf load 0.2 0.3 ma current consumption worst-case crystals (60 , 18pf or 100 , 10pf) 0.5 ma current consumption at maximum bias 1 ma table 13. low-frequency crystal specifications parameter test conditions min. typ. max. unit frequency 32.768 khz accuracy initial, temperature, and aging ? 100 + 100 ppm load capacitance (double this each side to ground) 12.5 pf crystal esr 100 k start-up time 1 s current consumption 0.5 a 4 .com u datasheet
functional description?system modules SN250 28/130 6.10.3 internal rc oscillator the SN250 has a low-power, low-frequency rc oscillator that runs all the time. its nominal frequency is 10khz. the rc oscillator has a coarse analog trim control, which is first adjusted to get the frequency as close to 10khz as possible. this raw clock is used by the chip management block. it is also divided down to 1khz using a variable divider to allow software to accurately calibrate it. this calibrated clock is available to the sleep timer. timekeeping accuracy depends on temperature fluctuations the chip is exposed to, power supply impedance, and the calibration interval, but in general it will be better than 150ppm (including crystal error of 40ppm). table 14 lists the specifications of the rc oscillator. 6.11 random number generator the SN250 allows for the generation of random numbers by exposing a randomly generated bit from the rx adc. analog noise current is passed through the rx path, sampled by the receive adc, and stored in a register. the value contained in this register could be used to seed a software-generated random number. the znet stack utilizes these random numbers to seed the random mac backoff and encryption key generators. 6.12 watchdog timer the SN250 contains a watchdog timer clocked from the internal oscillator. the watchdog is disabled by default, but can be enabled or disabled by software. if the timer reaches its time-out value of approximately 2 seconds, it will generate a reset signal to the chip. when software is running properly, the application can periodically restart this timer to prevent the reset signal from being generated. the watchdog will generate a low watermark interrupt in advance of actually resetting the chip. this low watermark interrupt occurs approximately 1.75 seconds after the timer has been restarted. this interrupt can be used to assist during application debug. table 14. rc oscillator specifications parameter test conditions min. typ. max. unit frequency 10 khz analog trim steps 1 khz frequency variation with supply for a voltage drop from 3.6v to 3.1v or 2.6v to 2.1v 0.5 % 4 .com u datasheet
SN250 functional description?system modules 29/130 6.13 sleep timer the 16-bit sleep timer is contained in the always-powered digital block. it has the following features: two output compare registers, with interrupts only compare a interrupt generates wake signal further clock divider of 2 n , for n = 0 to 10 the clock source for the sleep timer can be either the 32.768 khz clock or the calibrated 1khz clock (see table 15 ). after choosing the clock source, the frequency is slowed down with a 2 n prescaler to generate the final timer clock (see ta b le 1 6 ). legal values for n are 0 to 10. the slowest rate the sleep timer counter wraps is 2 16 ? 2 10 / 1khz 67109 sec. about 1118.48 min. 18.6 hrs. the znet software allows the application to define the clock source and prescaler value. therefore, a programmable sl eep/wake duty cycle can be conf igured according to the application requirements. 6.14 power management the SN250 supports three different power modes: processor active, processor idle, and deep sleep. the idle power mode stops code execution of the xap2b until any interrupt occurs or an external sif wakeup command is seen. all peripherals of the SN250 including the radio continue to operate normally. the deep sleep power mode powers off most of the SN250 but leaves the critical chip functions, such as the gpio pads and ram powered by the high voltage supply (vdd_pads). the SN250 can be woken by configuring the sleep timer to generate an interrupt after a period of time, using an external interrupt, or with the sif interface. activity on a serial interface may also be configured to wake the SN250, though actual reception of data is not re-enabled until the SN250 has finished waking up. depending on the speed of the serial data, it is possible to finish waking up in the middle of a byte. care must be taken to reset the serial interface between bytes and discard any garbage data before the rest. another condition for wakeup is general activity on gpio pins. the gpio activity monitoring is described in section 7.1. when in deep sleep, the internal regulator is disabled and vreg_out is turned off. all gpio output signals are maintained in a frozen state. additionally, the state of all registers in table 15. sleep timer clock source selection clk_sel clock source 0 calibrated 1khz clock 1 32.768khz clock table 16. sleep timer clock source prescaling clk_div[3:0] clock source prescale factor n = 0..10 2 n n = 11..15 2 10 4 .com u datasheet
functional description?system modules SN250 30/130 the powered-down low-voltage domain of the SN250 is lost. register settings for application peripherals should be preserved by the application as desired. the operation of deep sleep is controlled by znet apis which automatically preserve the state of necessary system peripherals. the internal xap2b cpu registers are automatically saved and restored to ram by hardware when entering and leaving the deep sleep m ode, allowing code execution to continue from where it left off. the event that caused the wakeup and any additional events that occurred while waking up are reported to the application via the znet apis. upon waking from deep sleep, the internal regulator is re-enabled. 4 .com u datasheet
SN250 functional description?application modules 31/130 7 functional description?application modules in application mode, access to privileged areas are blocked while access to application- specific modules such as gpio, serial controllers (sc1 and sc2), general purpose timers, adc, and event manager are enabled. 7.1 gpio the SN250 has 17 multi-purpose gpio pins that can be configured in a variety of ways. all pins have the following programmable features: selectable as input, output, or bi-directional. output can be totem pole, used as open drain or open source output for wired-or applications. can have internal pull-up or pull-down. the information flow between the gpio pin and its source are controlled by separate gpio data registers. the gpio_inh and gpio_inl registers report the input level of the gpio pins. the gpio_dirh and gpio_dirl registers enable the output signals for the gpio pins. the gpio_puh and gpio_pul registers enable pull-up resistors while gpio_pdh and gpio_pdl registers enable pull-down resistors on the gpio pins. the gpio_outh and gpio_outl control the output level. instead of changing the entire contents to the out/dir registers with one write access, a limited change can be applied. writing to the gpio_seth/l or gpio_dirseth/l register changes individual register bits from 0 to 1, while data bits that are already 1 are maintained. writing to the gpio_clrh/l or gpio_dirclrh/l register changes individual register bits from 1 to 0, while data bits that are already 0 are maintained. note that the value read from gpio_outh/l , gpio_seth/l , and gpio_clrh/l registers may not reflect the current pin state. to observe the pin state, the gpio_inh/l registers should be read. all registers controlling the gpio pin definitions are unaffected by power cycling the main core voltage (vdd_core). figure 5. gpio control logic 4 .com u datasheet
functional description?application modules SN250 32/130 the gpio_dbg register must always remain set to zero. the gpio_cfg register controls the gpio signal routing for alternate gpio functions as listed in table 17 . refer to table 1 for individual pin alternate functions. table 18 defines the alternate functions routed to the gpio. to allow more flexibility, the timer signals can come from alternative sources (e.g., tim1ia.1, tim1ia.2, tim1ia.3), depending on what serial controller functions are used. when the core is powered down, peripherals stop driving correct output signals. to maintain correct output signals, the system software will ensure that the gpio output signals are frozen before going into deep sleep. monitoring circuitry is in place to detect when the logic state of gpio input pins change. the lower 16 gpio pins that should be monitored can be chosen by software with the gpio_wakel register. the resulting event can be used for waking up from deep sleep as described in section 6.14 . 4 .com u datasheet
SN250 functional description?application modules 33/130 table 17. gpio pin configurations gpio_cfg[15:0] mode 0010 0000 0000 0000 default ---1 ---- ---- ---- enable pti_en + pti_data ---0 ---1 ---- ---- enable analog input adc0 ---0 ---0 ---- ---- enablegpio4 ---0 --1- ---- ---- enable analog input adc1 ---0 --0- ---- ---- enable gpio5 ---- -1-- ---- ---- enable analog input adc2 ---- -0-- ---- ---- enable gpio6 --1- ---- ---- ---- enable reg_en --0- 1--- ---- ---- enable analog input adc3 --0- 0--- ---- ---- enable gpio7 -1-- ---- ---- ---- enable vref_out -0-- ---- ---- ---- enable gpio8 ---- ---- 0000 ---- enable + cap2-0 + cap1-0 mode+ gpio[12,11,10,9,3,2,1,0] ---- ---- 0001 ---- enable sc1-2 + sc2-2 + cap2-0 + cap1-0 mode+gpio[12,11, 3, 0] ---- ---- 0010 ---- enable sc1-4a + sc2-4s + cap2-2 + cap1-2h mode ---- ---- 0011 ---- enable sc1-3m + sc2-3m + cap2-2 + cap1-2 mode+gpio[12, 3 ] ---- ---- 0100 ---- enable sc2-2 + cap2-0 + cap1-0 mode+gpio[12,11,10,9,3, 0] ---- ---- 0101 ---- enable sc1-2 + sc2-4s + cap2-0 + cap1-2h mode+gpio[12,11 ] ---- ---- 0110 ---- enable sc1-4a + sc2-3m + cap2-2 + cap1-2 mode+gpio[ 3 ] ---- ---- 0111 ---- enable sc1-3m + cap2-1 + cap1-0 mode+gpio[12 3,2,1,0] ---- ---- 1000 ---- enable sc2-4s + cap2-0 + cap1-1h mode+gpio[12,11,10,9 ] ---- ---- 1001 ---- enable sc1-2 + sc2-3m + cap2-0 + cap1-2 mode+gpio[12,11, 3 ] ---- ---- 1010 ---- enable sc1-4a + cap2-1 + cap1-0 mode+gpio[ 3,2,1,0] ---- ---- 1011 ---- enable sc1-3m + sc2-2 + cap2-2 + cap1-0 mode+gpio[12 3, 0] ---- ---- 1100 ---- enable sc2-3m + cap2-0 + cap1-1 mode+gpio[12,11,10,9,3 ] ---- ---- 1101 ---- enable sc1-2 + cap2-0 + cap1-0 mode+gpio[12,11, 3,2,1,0] ---- ---- 1110 ---- enable sc1-4a + sc2-2 + cap2-2 + cap1-0 mode+gpio[ 3, 0] ---- ---- 1111 ---- enable sc 1-3m + sc2-4s + cap2-2 + cap1-2h mode+gpio[12 ] ---- ---- ---- ---1 enable tmr2oa ---- ---- ---- ---0 enable gpio13 ---- ---- ---- --1- enable tmr2ob ---- ---- ---- --0- enable gpio14 ---- ---- ---- -1-- enable tmr1oa ---- ---- ---- -0-- enable gpio15 ---- ---- ---- 1--- enable tmr1ob ---- ---- ---- 0--- enablegpio16 4 .com u datasheet
functional description?application modules SN250 34/130 table 18. gpio pin functions gpio pin always connected input functions timer functions serial digital functions analog function output current drive 0 io tmr1ia.1 (when cap1-0 mode) mosi standard 1 io tmr2ia.2 (when cap2-1 mode) miso / sda standard 2 io tmr2ib.2 (when cap2-1 mode) msclk / scl standard 3 io tmr1ib.1 (when cap1-0 mode) ssel (input) standard 4 io pti_en adc0 input standard 5 io pti_data adc1 input standard 6 io tmr2clk, tmr1enmsk adc2 input standard 7io reg_en (open collector enable for external regulator) adc3 input standard 8 io / irqa tmr1clk, tmr2enmsk vref_out standard 9io tmr1ia.2 (when cap1-1 or cap1-1h mode) txd / mo / msda standard 10 io tmr1ib.2 (when cap1-1 mode) rxd / mi / mscl standard 11 io tmr2ia.1 (when cap2-0 mode) cts / mclk standard 12 io tmr2ib.1 (when cap2-0 mode) rts standard 13 io tmr2oa tmr1ia.3 (when cap1-2h or cap1-2 mode) high 14 io / irqb tmr2ob tmr1ib.3 (when cap1-2 mode) high 15 io / irqc tmr1oa tmr2ia.3 (when cap2-2 mode) high 16 io / irqd tmr1ob tmr2ib.3 (when cap2-2 mode) high 4 .com u datasheet
SN250 functional description?application modules 35/130 7.1.1 registers gpio_cfg [0x4712] gpio_inh [0x4700] gpio_inl [0x4702] 15 0-r 14 0-rw 13 1-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0gpio_cfg gpio_cfg 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 gpio_cfg [14:0] gpio configuration modes. refer to table 1 and table 17 for the mode settings. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0gpio_inh 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 gpio_inh [0] read the input level of gpio[16] pin. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r gpio_inl gpio_inl 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 gpio_inl [15:0] read the input level of gpio[15:0] pins. 4 .com u datasheet
functional description?application modules SN250 36/130 gpio_outh [0x4704] gpio_outl [0x4706] gpio_seth [0x4708] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 gpio_outh 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-rw 0 gpio_outh [0] write the output level of gpio[16] pin. the value read may not match the actual value on the pin. 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw gpio_outl gpio_outl 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 gpio_outl [15:0] write the output level of gpio[15:0] pins. the value read may not match the actual value on the pin. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 gpio_set h 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-w 0 gpio_seth [0] set the output level of gpio[16] pin. only writing ones into this register will have an effect. any bit that has one written to it will cause the corresponding bit in gpio_outh to become 1. 4 .com u datasheet
SN250 functional description?application modules 37/130 gpio_setl [0x470a] gpio_clrh [0x470c] gpio_clrl [0x470e] 15 0-w 14 0-w 13 0-w 12 0-w 11 0-w 10 0-w 9 0-w 8 0-w gpio_setl gpio_setl 0-w 7 0-w 6 0-w 5 0-w 4 0-w 3 0-w 2 0-w 1 0-w 0 gpio_setl [15:0] set the output level of gpio[15:0] pins. only writing ones into this register will have an effect. any bit that has one written to it will cause the corresponding bit in gpio_outl to become 1. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0gpio_clrh 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-w 0 gpio_clrh [0] clear the output level of gpio[16] pin. only writing ones into this register will have an effect. any bit that has one written to it will cause the corresponding bit in gpio_outh to become 0. 15 0-w 14 0-w 13 0-w 12 0-w 11 0-w 10 0-w 9 0-w 8 0-w gpio_clrl gpio_clrl 0-w 7 0-w 6 0-w 5 0-w 4 0-w 3 0-w 2 0-w 1 0-w 0 gpio_clrl [15:0] clear the output level of gpio[15:0] pins. only writing ones into this register will have an effect. any bit that has one written to it will cause the corresponding bit in gpio_outl to become 0. 4 .com u datasheet
functional description?application modules SN250 38/130 gpio_dirh [0x4714] gpio_dirl [0x4716] gpio_dirseth [0x4718] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0gpio_dirh 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-rw 0 gpio_dirh [0] enable the output of gpio[16] pin. 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw gpio_dirl gpio_dirl 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 gpio_dirl [15:0] enable the output of gpio[15:0] pins. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 gpio_ dirseth 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-w 0 gpio_dirseth [0] set the output enable of gpio[16] pin. only writing ones into this register will have an effect. any bit that has one written to it will cause the corresponding bit in gpio_dirh to become 1. 4 .com u datasheet
SN250 functional description?application modules 39/130 gpio_dirsetl [0x471a] gpio_dirclrh [0x471c] gpio_dirclrl [0x471e] 15 0-w 14 0-w 13 0-w 12 0-w 11 0-w 10 0-w 9 0-w 8 0-w gpio_dirsetl gpio_dirsetl 0-w 7 0-w 6 0-w 5 0-w 4 0-w 3 0-w 2 0-w 1 0-w 0 gpio_dirsetl [15:0] set the output enable of gpio[15:0] pins. only writing ones into this register will have an effect. any bit that has one written to it will cause the corresponding bit in gpio_dirl to become 1. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 gpio_ dirclrh 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-w 0 gpio_dirclrh [0] clear the output enable of gpio[16] pin. only writing ones into this register will have an effect. any bit that has one written to it will cause the corresponding bit in gpio_dirh to become 0. 15 0-w 14 0-w 13 0-w 12 0-w 11 0-w 10 0-w 9 0-w 8 0-w gpio_dirclrl gpio_dirclrl 0-w 7 0-w 6 0-w 5 0-w 4 0-w 3 0-w 2 0-w 1 0-w 0 gpio_dirclrl [15:0] clear the output enable of gpio[15:0] pins. only writing ones into this register will have an effect. any bit that has one written to it will cause the corresponding bit in gpio_dirl to become 0. 4 .com u datasheet
functional description?application modules SN250 40/130 gpio_pdh [0x4720] gpio_pdl [0x4722] gpio_puh [0x4724] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 gpio_pdh 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-rw 0 gpio_pdh [0] set this bit to enable pull-down resistors on gpio[16] pin. 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw gpio_pdl gpio_pdl 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 gpio_pdl [15:0] set this bit to enable pull-down resistors on gpio[15:0] pins. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0gpio_puh 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-rw 0 gpio_puh [0] set this bit to enable pull-up resistors on gpio[16] pin. 4 .com u datasheet
SN250 functional description?application modules 41/130 gpio_pul [0x4726] gpio_wakel [0x4728] gpio_intcfga [0x4630] 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw gpio_pul gpio_pul 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 gpio_pul [15:0] set this bit to enable pull-up resistors on gpio[15:0] pins. 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw gpio_wakel gpio_wakel 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 gpio_wakel [15:0] setting bits will enable gpio wakeup monitoring for changing states on gpio[15:0] pins. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-rw 0 0 0 0 0 0 0 gpio_ intfilt gpio_intmod 0 0 0 0 0 0-rw 7 0-rw 6 0-rw 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 gpio_intfilt [8] set this bit to enable gpio irqa filter. gpio_intmod [7:5] gpio irqa input edge triggering selection: 0 = disabled; 1 = rising; 2 = falling; 3 = both edges; 4 = active high triggered; 5 = active low trigger; 6,7 = reserved. 4 .com u datasheet
functional description?application modules SN250 42/130 gpio_intcfgb [0x4632] gpio_intcfgc [0x4634] gpio_intcfgd [0x4636] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-rw 0 0 0 0 0 0 0 gpio_intfilt gpio_intmod 0 0 0 0 0 0-rw 7 0-rw 6 0-rw 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 gpio_intfilt [8] set this bit to enable gpio irqb filter gpio_intmod [7:5] gpio irqb input edge triggering selection: 0 = disabled; 1 = rising; 2 = falling; 3 = both edges; 4 = active high triggered; 5 = active low trigger; 6,7 = reserved. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-rw 0 0 0 0 0 0 0 gpio_intfilt gpio_intmod 0 0 0 0 0 0-rw 7 0-rw 6 0-rw 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 gpio_intfilt [8] set this bit to enable gpio irqc filter. gpio_intmod [7:5] gpio irqc input edge triggering selection: 0 = disabled; 1 = rising; 2 = falling; 3 = both edges; 4 = active high triggered; 5 = active low trigger; 6,7 = reserved. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-rw 0 0 0 0 0 0 0 gpio_intfilt gpio_intmod 0 0 0 0 0 0-rw 7 0-rw 6 0-rw 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 gpio_intfilt [8] set this bit to enable gpio irqd filter. gpio_intmod [7:5] gpio irqd input edge triggering selection: 0 = disabled; 1 = rising; 2 = falling; 3 = both edges; 4 = active high triggered; 5 = active low trigger; 6,7 = reserved. 4 .com u datasheet
SN250 functional description?application modules 43/130 int_gpiocfg [0x4628] int_gpioflag [0x4610] gpio_dbg [0x4710] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 int_gpiod int_gpioc int_gpiob int_gpioa 0-r 7 0-r 6 0-r 5 0-r 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 int_gpiod [3] gpio irqd interrupt enable. int_gpioc [2] gpio irqc interrupt enable. int_gpiob [1] gpio irqb interrupt enable. int_gpioa [0] gpio irqa interrupt enable. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 int_gpiod int_gpioc int_gpiob int_gpioa 0-r 7 0-r 6 0-r 5 0-r 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 int_gpiod [3] gpio irqd interrupt pending. int_gpioc [2] gpio irqc interrupt pending. int_gpiob [1] gpio irqb interrupt pending. int_gpioa [0] gpio irqa interrupt pending. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0gpio_dbg 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-rw 1 0-rw 0 gpio_dbg [1:0] this register must remain zero. 4 .com u datasheet
functional description?application modules SN250 44/130 7.2 serial controller sc1 the SN250 sc1 module provides asynchronous (uart) or synchronous (spi or i 2 c) serial communications. figure 6 is a block diagram of the sc1 module. figure 6. sc1 block diagram the full-duplex interface of the sc1 module can be configured into one of these three communication modes, but it cannot run them simultaneously. to reduce the interrupt service requirements of the cpu, the sc1 module contains buffered data management schemes for the three modes. a dedicated, buffered dma controller is available to the spi and uart controllers while a fifo is available to all three modes. in addition, a sc1 data register allows the software application direct access to the sc1 data within all three modes. finally, the sc1 routes the interface signals to gpio pins. these are shared with other functions and are controlled by the gpio_cfg register. for selecting alternate pin functions, please refer to table 17 and table 18 . 4 .com u datasheet
SN250 functional description?application modules 45/130 7.2.1 uart mode the sc1 uart controller is enabled with sc1_mode set to 1. the uart mode contains the following features: baud rate (300bps up to 921kbps) data bits (7 or 8) parity bits (none, odd, or even) stop bits (1 or 2) the following signals can be made available on gpio pins: txd rxd rts (optional) cts (optional) the sc1 uart module obtains its reference baud-rate clock from a programmable baud generator. baud rates are set by a clock division ratio from the 24mhz clock: rate = 24mhz / ( 2 ? ( n + (0.5 ? f) ) ) the integer portion, n, is written to the sc1_uartper register and the fractional remainder, f, to the sc1_uartfrac register. table 19 lists the supported baud rates with associated baud rate error. the minimum allowable setting for sc1_uartper is 8. the uart module supports various frame formats depending upon the number of data bits ( sc1_uart8bit ), the number of stop bits ( sc1_uart2stp ), and the parity ( sc1_uartpar plus sc1_uartodd ). the register bits sc1_uart8bit , sc1_uart2stp , sc1_uartpar , and sc1_uartodd are defined within the sc1_uartcfg register. in addition, the uart module supports flow control by setting sc1_uartflow , sc1_uartauto , and sc1_uartrts in the sc1_uartcfg register (see ta b le 2 0 ). table 19. uart baud rates baud rate (bps) sc1_uartper sc1_uartfrac baud rate error (%) 300 40000 0 0 4800 2500 0 0 9600 1250 0 0 19200 625 0 0 38400 312 1 0 57600 208 1 ? 0.08 115200 104 0 0.16 460800 26 0 0.16 921600 13 0 0.16 4 .com u datasheet
functional description?application modules SN250 46/130 characters transmitted and received are passed through transmit and receive fifos. the transmit and receive fifos are 4 bytes deep. the fifos are accessed under software control by accessing the sc1_data data register or under hardware control by the sc1 dma. when a transmit character is written to the (empty) transmit fifo, the register bit sc1_uarttxidle in the sc1_uartstat register clears to indicate that not all characters are transmitted yet. further transmit characters can be written to the transmit fifo until it is full, which causes the register bit sc1_uarttxfree in the sc1_uartstat register to clear. after shifting one transmit character to the txd pin, space for one transmit character becomes available in the transmit fifo. this causes the register bit sc1_uarttxfree in the sc1_uartstat register to get set. after all characters are shifted out, the transmit fifo empties, which causes the register bit sc1_uarttxidle in the sc1_uartstat register to get set. a received character is stored with its parity and frame error status in the receive fifo. the register bit sc1_uartrxval in the sc1_uartstat register is set to indicate that not all received characters are read out from the receive fifo. the error status of a received byte is available with the register bits sc1_uartparerr and sc1_uartfrmerr in the sc1_uartstat register. when the dma controller is transferring the data from the receive fifo to a memory buffer, it checks the stor ed parity and frame error status flags. when an error is flagged, the sc1_rxerra/b register is updated, marking the offset to the first received character with parity or frame error. when the 4-character receive fifo contains 3 characters, flow control needs to be used to avoid an overflow event. one method is to use software handshaking by transmitting reserved xon/xoff characters which are interpreted by the transmitting terminal to pause further transmissions (to the receive fifo). another method is to use hardware handshaking using xoff assertion through the rts signal. table 20. configuration table for the uart module sc1_uartcfg gpio_cfg[7:4] gpio-pin function sc1_mode sc1_uartflow sc1_uartauto sc1_uartrts 1 0 - - sc1-2 mode txd/rxd output/input 1 1 - - sc1-2 mode illegal 1 1 0 0/1 sc1-4a mode txd/rxd/cts output/input/input rts output = on/off 1 1 1 - sc1-4a mode txd/rxd/cts output/input/input rts output = on if 2 or more bytes will fit in receive buffer 1 0 1 - sc1-4a mode reserved 1 0 0 - sc1-4a mode illegal 1 - - - sc1-3m mode illegal 4 .com u datasheet
SN250 functional description?application modules 47/130 there are two schemes available to assert the rts signal. the first scheme is to initiate rts assertion with software by setting the register bit sc1_uartrts in the sc1_uartcfg register. the second scheme is to assert rts automatically depending on the fill state of the receive fifo. this is enabled with the register bit sc1_uartauto in the sc1_uartcfg register. the uart also contains overrun protection for both the fifo and dma options. if the transmitting terminal continues to transmit characters to the receive fifo, only 4 characters are stored in the fifo. additional characters are dropped, and the register bit sc1_uartrxovf in the sc1_uartstat register is set. should this receive overrun occur during dma operation, the sc1_rxerra/b registers mark the error-offset. the rx fifo hardware generates the int_scrxovf interrupt, but the dma register will not indicate the error condition until the rx fifo is drained. once the dma marks a rx error, there are two conditions that will clear the error indication: setting the appropriate sc_tx/rxdmarst bit in the sc1_dmactrl register, or loading the appropriate dma buffer after it has unloaded. interrupts are generated on the following events: transmit fifo empty and last character shifted out (0 to 1 transition of sc1_uarttxidle ) transmit fifo changed from full to not full (0 to 1 transition of sc1_uarttxfree ) receive fifo changed from empty to not empty (0 to 1 transition of sc1_uartrxval ) transmit dma buffer a/b complete (1 to 0 transition of sc_txacta/b ) receive dma buffer a/b complete (1 to 0 transition of sc_rxacta/b ) character received with parity error character received with frame error received and lost character while receive fifo was full (receive overrun error) to generate interrupts to the cpu, the interrupt masks in the int_sc1cfg and int_cfg registers must be enabled. 7.2.2 spi master mode the spi mode of the sc1 is master mode only. it has a fixed word length of 8 bits. the sc1 spi controller is enabled with sc1_mode set to 2 and register bit sc_spimst set in the sc1_spicfg register. the spi mode has the following features: full duplex operation programmable clock frequency (12mhz max.) programmable clock polarity and clock phase selectable data shift direction (either lsb or msb first) the following signals can be made available on the gpio pins: mo (master out) mi (master in) mclk (serial clock) the sc1 spi module obtains its reference clock from a programmable clock generator. clock rates are set by a clock division ratio from the 24mhz clock: rate = 24mhz / ( 2 ? (lin + 1) ? 2 exp ) 4 .com u datasheet
functional description?application modules SN250 48/130 exp is written to the sc1_rateexp register and lin to the sc1_ratelin register. since the range for both values is 0 to 15, the fastest data rate is 12mbps and the slowest rate is 22.9bps. the sc1 spi master supports various frame formats depending upon the clock polarity ( sc_spipol ), clock phase ( sc_spipha ), and direction of data ( sc_spiord ) (see table 21 ). the register bits sc_spipol , sc_spipha , and sc_spiord are defined within the sc1_spicfg register. note: switching the spi configuration from sc_spipol=1 to sc_spipol=0 without subsequently setting sc1_mode=0 and reinitializing the spi will cause an extra byte ( 0xfe ) to be transmitted immediately before the first intended byte. serialized sc1 spi transmit data is driven to the output pin mo. sc1 spi master data is received from the input pin mi. to generate slave select signals to spi slave devices, other gpio pins have to be used and their assertion must be controlled by software. characters transmitted and received are passed through transmit and receive fifos. the transmit and receive fifos are 4 bytes deep. these fifos are accessed under software control by accessing the sc1_data data register or under hardware control using a dma controller. table 21. sc1 spi master frame format sc1_mode sc1_spicfg gpio_cfg[7:4] frame format sc_spimst sc_spiord sc_spipha sc_spipol 21000 sc1-3m mode 21001 sc1-3m mode 21010 sc1-3m mode 21011 sc1-3m mode 211 - - sc1-3m mode same as above except lsb first instead of msb first 21--- sc1-2 mode illegal 21--- sc1-4a mode illegal 4 .com u datasheet
SN250 functional description?application modules 49/130 when a transmit character is written to the (empty) transmit fifo, the register bit sc_spitxidle in the sc1_spistat register clears and indicates that not all characters are transmitted yet. further transmit characters can be written to the transmit fifo until it is full, which causes the register bit sc_spitxfree in the sc1_spistat register to clear. after shifting one transmit character to the mo pin, space for one transmit character becomes available in the transmit fifo. this causes the register bit sc_spitxfree in the sc1_spistat register to get set. after all characters are shifted out, the transmit fifo empties, which causes the register bit sc_spitxidle in the sc1_spistat register to get set also. any character received is stored in the (empty) receive fifo. the register bit sc_spirxval in the sc1_spistat register is set to indicate that not all received characters are read out from receive fifo. if software or dma is not reading from the receive fifo, the receive fifo will store up to 4 characters. any further reception is dropped and the register bit sc_spirxovf in the sc1_spistat register is set. the rx fifo hardware generates the int_scrxovf interrupt, but the dma register will not indicate the error condition until the rx fifo is drained. once the dma marks a rx error, there are two conditions that will clear the error indication: setting the appropriate sc_tx/rxdmarst bit in the sc1_dmactrl register, or loading the appropriate dma buffer after it has unloaded. receiving a character always requires transmitting a character. in a case when a long stream of receive characters is expected, a long sequence of (dummy) transmit characters must be generated. to avoid software or transmit dma initiating these transfers (and consuming unnecessary bandwidth), the spi serializer can be instructed to retransmit the last transmitted character, or to transmit a busy token ( 0xff ), which is determined by the register bit sc_spirpt in the sc1_spicfg register. this functionality can only be enabled (or disabled) when the transmit fifo is empty and the transmit serializer is idle, as indicated by a cleared sc_spitxidle register bit in the sc1_spistat register. every time an automatic character transmission is started, a transmit underrun is detected (as there is no data in transmit fifo), and the register bit int_sctxund in the int_sc1flag register is set. note that after disabling the automatic character transmission, the reception of new characters stops and the receive fifo holds characters just received. important: receive dma complete event does not automatically mean receive fifo empty. interrupts are generated on the following events: transmit fifo empty and last character shifted out (0 to 1 transition of sc_spitxidle ) transmit fifo changed from full to not full (0 to 1 transition of sc_spitxfree ) receive fifo changed from empty to not empty (0 to 1 transition of sc_spirxval ) transmit dma buffer a/b complete (1 to 0 transition of sc_txacta/b ) receive dma buffer a/b complete (1 to 0 transition of sc_rxacta/b ) received and lost character while receive fifo was full (receive overrun error) transmitted character while transmit fifo was empty (transmit underrun error) to generate interrupts to the cpu, the interrupt masks in the int_sc1cfg and int_cfg registers must be enabled. 4 .com u datasheet
functional description?application modules SN250 50/130 7.2.3 i 2 c master mode the sc1 i 2 c controller is only available in master mode. the sc1 i 2 c controller is enabled with sc1_mode set to 3. the i 2 c master controller supports standard (100kbps) and fast (400kbps) i 2 c modes. address arbitration is not implemented, so multiple master applications are not supported. the i 2 c signals are pure open-collector signals, and external pull-up resistors are required. the sc1 i 2 c mode has the following features: programmable clock frequency (400khz max.) supports both 7-bit and 10-bit addressing the following signals can be made available on the gpio pins: msda (serial data) mscl (serial clock) the i 2 c master controller obtains its reference clock from a programmable clock generator. clock rates are set by a clock division ratio from the 24mhz clock: exp is written to the sc1_rateexp register and lin to the sc1_ratelin register. table 22 shows the rate settings for standard i 2 c (100kbps) and fast i 2 c (400kbps) operation. note that at 400kbps, the i 2 c specification requires the minimum low period of scl to be 1.3s. to be strictly i 2 c compliant, the rate needs to be lowered to 375kbps. the i 2 c master controller supports generation of various frame segments controlled with the register bits sc_i2cstart , sc_i2cstop , sc_i2csend , and sc_i2crecv in the sc1_i2cctrl1 registers. ta b le 2 3 summarizes these frames. table 22. i 2 c nominal rate programming nominal rate sc1_ratelin sc1_rateexp 100kbps 14 3 375kpbs 15 1 400kbps 14 1 nominal rate 24mhz 2lin1 + () 2 exp ?? ------------------------------------------------- = 4 .com u datasheet
SN250 functional description?application modules 51/130 table 23. sc1 i 2 c master frame segments sc1_mode sc1_i2cctrl1 gpio_cfg[7:4] frame segments sc_i2cstart sc_i2csend sc_i2crecv sc_i2cstop 31000 sc1-2 mode 30100 sc1-2 mode 30010 sc1-2 mode 30001 sc1-2 mode 30000 sc1-2 mode no pending frame segment 3 1 - - 1 1 1 - - - 1 1 - - - 1 1 sc1-2 mode illegal 4 .com u datasheet
functional description?application modules SN250 52/130 full i 2 c frames have to be constructed under software control by generating individual i 2 c segments. all necessary segment transitions are shown in figure 7 . ack or nack generation of an i 2 c receive frame segment is determined with the register bit sc_i2cack in the sc1_i2cctrl2 register. figure 7. i 2 c segment transitions generation of a 7-bit address is accomplished with one transmit segment. the upper 7 bits of the transmitted character contain the 7-bit address. the remaining lower bit contains the command type (?read? or ?write?). generation of a 10-bit address is accomplished with two transmit segments. the upper 5 bits of the first transmit character must be set to 0x1e . the next 2 bits are for the 2 most significant bits of the 10-bit address. the remaining lower bit contains the command type 3---- sc1-4m mode illegal 3---- sc1-4a mode illegal table 23. sc1 i 2 c master frame segments (continued) sc1_mode sc1_i2cctrl1 gpio_cfg[7:4] frame segments sc_i2cstart sc_i2csend sc_i2crecv sc_i2cstop 4 .com u datasheet
SN250 functional description?application modules 53/130 (?read? or ?write?). the second transmit segment is for the remaining 8 bits of the 10-bit address. characters received and transmitted are passed through receive and transmit fifos. the sc1 i 2 c master transmit and receive fifos are 1-byte deep. these fifos are accessed under software control. (re)start and stop segments are initiated by setting the register bits sc_i2cstart or sc_i2cstop in the sc1_i2cctrl1 register followed by waiting until they have cleared. alternatively, the register bit sc_i2ccmdfin in the sc1_i2cstat can be used for waiting. to initiate a transmit segment, the data have to be written to the sc1_data data register, followed by setting the register bit sc_i2csend in the sc1_i2cctrl1 register, and completed by waiting until it clears. alternatively, the register bit sc_i2ctxfin in the sc1_i2cstat can be used for waiting. a receive segment is initiated by setting the register bit sc_i2crecv in the sc1_i2cctrl1 register, waiting until it clears, and then reading from the sc1_data data register. alternatively, the register bit sc_i2crxfin in the sc1_i2cstat can be used for waiting. now the register bit sc_i2crxnak in the sc1_i2cstat register indicates if a nack or ack was received from an i 2 c slave device. interrupts are generated on the following events: bus command ( sc_i2cstart / sc_i2cstop ) completed (0 to 1 transition of sc_i2ccmdfin ) character transmitted and slave device responded with nack character transmitted (0 to 1 transition of sc_i2ctxfin ) character received (0 to 1 transition of sc_i2crxfin ) received and lost character while receive fifo was full (receive overrun error) transmitted character while transmit fifo was empty (transmit underrun error) to generate interrupts to the cpu, the interrupt masks in the int_sc1cfg and int_cfg registers must be enabled. 4 .com u datasheet
functional description?application modules SN250 54/130 7.2.4 registers sc1_mode [0x44aa] sc1_data [0x449e] sc1_uartper [0x44b4] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sc1_mode 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-rw 1 0-rw 0 sc1_mode [1:0] sc1 mode: 0 = disabled; 1 = uart mode; 2 = spi mode; 3 = i 2 c mode. note to change between modes, the previous mode must be disabled first. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 sc1_data 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_data [7:0] transmit and receive data register. writing to this register pushes a byte onto the transmit fifo. reading from this register pulls a byte from the receive fifo. 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw sc1_uartper sc1_uartper 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_uartper [15:0] the baud rate period (n) of the clock rate as seen in the equation: rate 24mhz 2n 0.5f ? () + () ? -------------------------------------------- = 4 .com u datasheet
SN250 functional description?application modules 55/130 sc1_uartfrac [0x44b6] sc1_uartcfg [0x44ae] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sc1_ uartfrac 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-rw 0 sc1_uartfrac [0] the baud rate fractional remainder (f) of the clock rate as derived from the equation: 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 sc1_ uartauto sc1_ uartflow sc1_ uartodd sc1_ uartpar sc1_ uart2stp sc1_ uart8bit sc1_ uartrts 0-r 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_uartauto [6] set this bit to enable automatic rts assertion by hardware. rts will be deasserted when the uart can receive only one more character before the buffer is full. rts will be reasserted when the uart can receive more than one character before the buffer is full. the sc1_uartrts bit in this register has no effect when this bit is set. sc1_uartflow [5] set this bit to enable rts/cts signals. clear this bit to disable the signals. when this bit is cleared, the cts signal is asserted in hardware to enable the uart transmitter. the gpio_cfg register should be configured for mode sc1-4a for hardware handshake with rts/cts and sc1-2 for no handshaking. sc1_uartodd [4] clear this bit for even parity. set this bit for odd parity. sc1_uartpar [3] clear this bit for no parity. set this bit for one parity bit. sc1_uart2stp [2] clear this bit for one stop bit. set this bit for two stop bits sc1_uart8bit [1] clear this bit for seven data bits. set this bit for eight data bits. sc1_uartrts [0] rts is an output signal. when this bit is set, the signal is asserted (== ttl logic 0, gpio is low, ?xon?, rs232 positive voltage), the transmission will proceed. when this bit is cleared, the signal is deasserted (== ttl logic 1, gpio is high, ?xoff?, rs232 negative voltage), the transmission is inhibited. rate 24mhz 2n 0.5f ? () + () ? -------------------------------------------- = 4 .com u datasheet
functional description?application modules SN250 56/130 sc1_uartstat [0x44a4] sc1_ratelin [0x44b0] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 sc1_ uarttxidle sc1_ uartparerr sc1_ uartfrmerr sc1_ uartrxovf sc1_ uarttxfree sc1_ uartrxval sc1_ uartcts 0-r 7 1-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc1_uarttxidle [6] this bit is set when the transmit fifo is empty and the transmitter is idle. sc1_uartparerr [5] this bit is set when the receive fifo has seen a parity error. this bit clears when the data register (sc1_data) is read. sc1_uartfrmerr [4] this bit is set when the receive fifo has seen a frame error. this bit clears when the data register (sc1_data) is read. sc1_uartrxovf [3] this bit is set when the receive fifo has been overrun. this bit clears when the data register (sc1_data) is read. sc1_uarttxfree [2] this bit is set when the transmit fifo is ready to accept at least one byte. sc1_uartrxval [1] this bit is set when the receive fifo contains at least one byte. sc1_uartcts [0] this bit shows the current state of the cts input signal at the cts pin (pin 19, gpio11). when cts = 1, the signal is asserted (== ttl logic 0, gpio is low, ?xon?, rs232 positive voltage), the transmission will proceed. when cts = 0, the signal is deasserted (== ttl logic 1, gpio is high, ?xoff?, rs232 negative voltage), transmission is inhibited at the end of the current character. any characters in the transmit buffer will remain there. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc1_ratelin 0-r 7 0-r 6 0-r 5 0-r 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_ratelin [3:0] the linear component (lin) of the clock rate as seen in the equation: rate 24 mhz 2lin1 + () 2 exp ?? ------------------------------------------------- = 4 .com u datasheet
SN250 functional description?application modules 57/130 sc1_rateexp [0x44b2] sc1_spicfg [0x44ac] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc1_rateexp 0-r 7 0-r 6 0-r 5 0-r 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_rateexp [3:0] the exponential component (exp) of the clock rate as seen in the equation: 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 sc_ spirxdrv sc_spimst sc_spirpt sc_spiord sc_spipha sc_spipol 0-r 7 0-r 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc_spirxdrv [5] receiver-driven mode selection bit (spi master mode only). clearing this bit will initiate transactions when transmit data is available. setting this bit will initiate transactions when the receive buffer (fifo or dma) has space. sc_spimst [4] this bit must always be set to put the spi in master mode (slave mode is not valid). sc_spirpt [3] this bit controls behavior on a transmit buffer underrun condition in slave mode. clearing this bit will send the busy token (0xff) and setting this bit will repeat the last byte. changing this bit will only take effect when the transmit fifo is empty and the transmit serializer is idle. sc_spiord [2] clearing this bit will result in the most significant bit being transmitted first while setting this bit will result in the least significant bit being transmitted first. sc_spipha [1] clock phase configuration is selected with clearing this bit for sampling on the leading (first edge) and setting this bit for sampling on second edge. sc_spipol [0] clock polarity configuration is selected with clearing this bit for a rising leading edge and setting this bit for a falling leading edge. rate 24mhz 2lin1 + () 2 exp ?? ------------------------------------------------- = 4 .com u datasheet
functional description?application modules SN250 58/130 sc1_spistat [0x44a0] sc1_i2cctrl1 [0x44a6] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc_ spitxidle sc_ spitxfree sc_ spirxval sc_ spirxovf 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc_spitxidle [3] this bit is set when the transmit fifo is empty and the transmitter is idle. sc_spitxfree [2] this bit is set when the transmit fifo is ready to accept at least one byte. sc_spirxval [1] this bit is set when the receive fifo contains at least one byte. sc_spirxovf [0] this bit is set when the receive fifo has been overrun. this bit clears when the data register (sc1_data) is read. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc_ i2cstop sc_ i2cstart sc_ i2csend sc_ i2crecv 0-r 7 0-r 6 0-r 5 0-r 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc_i2cstop [3] setting this bit sends the stop command. it auto clears when the command completes. sc_i2cstart [2] setting this bit sends the start or repeated start command. it autoclears when the command completes. sc_i2csend [1] setting this bit transmits a byte. it autoclears when the command completes. sc_i2crecv [0] setting this bit receives a byte. it autoclears when the command completes. 4 .com u datasheet
SN250 functional description?application modules 59/130 sc1_i2cctrl2 [0x44a8] sc1_i2cstat [0x44a2] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sc_i2cac k 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-rw 0 sc_i2cack [0] setting this bit will signal ack after a received byte. clearing this bit will signal nack after a received byte. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc_ i2ccmdfin sc_ i2crxfin sc_ i2ctxfin sc_ i2crxnak 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc_i2ccmdfin [3] this bit is set when a start or stop command completes. it autoclears on next bus activity. sc_i2crxfin [2] this bit is set when a byte is received. it autoclears on next bus activity. sc_i2ctxfin [1] this bit is set when a byte is transmitted. it autoclears on next bus activity. sc_i2crxnak [0] this bit is set when a nack is received from the slave. it autoclears on next bus activity. 4 .com u datasheet
functional description?application modules SN250 60/130 sc1_dmactrl [0x4498] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 sc_ txdmarst sc_ rxdmarst sc_txlodb sc_txloda sc_rxlodb sc_rxloda 0-r 7 0-r 6 0-w 5 0-w 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc_txdmarst [5] setting this bit will reset the transmit dma. the bit is autocleared. sc_rxdmarst [4] setting this bit will reset the receive dma. this bit is autocleared. sc_txlodb [3] setting this bit loads dma transmit buffer b addresses and starts the dma controller processing transmit buffer b. this bit is autocleared when dma completes. writing a zero to this bit will not have any effect. reading this bit as one indicates dma processing for buffer b is active or pending. reading this bit as zero indicates dma processing for buffer b is complete or idle. sc_txloda [2] setting this bit loads dma transmit buffer a addresses and starts the dma controller processing transmit buffer a. this bit is autocleared when dma completes. writing a zero to this bit will not have any effect. reading this bit as one indicates dma processing for buffer a is active or pending. reading this bit as zero indicates dma processing for buffer a is complete or idle. sc_rxlodb [1] setting this bit loads dma receive buffer b addresses and starts the dma controller processing receive buffer b. this bit is autocleared when dma completes. writing a zero to this bit will not have any effect. reading this bit as one indicates dma processing for buffer b is active or pending. reading this bit as zero indicates dma processing for buffer b is complete or idle. sc_rxloda [0] setting this bit loads dma receive buffer a addresses and starts the dma controller processing receive buffer a. this bit is autocleared when dma completes. writing a zero to this bit will not have any effect. reading this bit as one indicates dma processing for buffer a is active or pending. reading this bit as zero indicates dma processing for buffer a is complete or idle. 4 .com u datasheet
SN250 functional description?application modules 61/130 sc1_dmastat [0x4496] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 sc1_ rxfrmb sc1_ rxfrma sc1_ rxparb sc1_ rxpara sc_rxovf b sc_rxovf a sc_txact b sc_txact a sc_rxact b sc_rxact a 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc1_rxfrmb [9] this bit is set when dma receive buffer b was passed a frame error from the lower hardware fifo. this bit is autocleared the next time buffer b is loaded or when the receive dma is reset. sc1_rxfrma [8] this bit is set when dma receive buffer a was passed a frame error from the lower hardware fifo. this bit is autocleared the next time buffer a is loaded or when the receive dma is reset. sc1_rxparb [7] this bit is set when dma receive buffer b was passed a parity error from the lower hardware fifo. this bit is autocleared the next time buffer b is loaded or when the receive dma is reset. sc1_rxpara [6] this bit is set when dma receive buffer a was passed a parity error from the lower hardware fifo. this bit is autocleared the next time buffer a is loaded or when the receive dma is reset. sc_rxovfb [5] this bit is set when dma receive buffer b was passed an overrun error from the lower hardware fifo. neither receive buffers were capable of accepting any more bytes (unloaded), and the fifo f illed up. buffer b was the next buffer to load, and when it drained the fifo, the overrun error was passed up to the dma and flagged with this bit. this bit is autocleared the next time buffer b is loaded or when the receive dma is reset. sc_rxovfa [4] this bit is set when dma receive buffer a was passed an overrun error from the lower hardware fifo. neither receive buffers were capable of accepting any more bytes (unloaded), and the fifo f illed up. buffer a was the next buffer to load, and when it drained the fifo the overrun error was passed up to the dma and flagged with this bit. this bit is autocleared the next time buffer a is loaded or when the receive dma is reset. sc_txactb [3] this bit is set when dma transmit buffer b is currently active. sc_txacta [2] this bit is set when dma transmit buffer a is currently active. sc_rxactb [1] this bit is set when dma receive buffer b is currently active. sc_rxacta [0] this bit is set when dma receive buffer a is currently active. 4 .com u datasheet
functional description?application modules SN250 62/130 sc1_rxcnta [0x4490] sc1_rxcntb [0x4492] sc1_txcnt [0x4494] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 sc1_rxcnta sc1_rxcnta 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc1_rxcnta [12:0] a byte offset (from 0) which points to the location in dma receive buffer a where the next byte will be placed. when the buffer fills and subsequently unloads, this register wraps around and holds the value zero (pointing back to the first location in the buffer). 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 sc1_rxcntb sc1_rxcntb 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc1_rxcntb [12:0] a byte offset (from 0) which points to the location in dma receive buffer b where the next byte will be placed. when the buffer fills and subsequently unloads, this register wraps around and holds the value zero (pointing back to the first location in the buffer). 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 sc1_txcnt sc1_txcnt 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc1_txcnt [12:0] a byte offset (from 0) which points to the location in the active (loaded) dma transmit buffer where the next byte will be placed. when the buffer fills and subsequently unloads, this register wraps around and holds the value zero (pointing back to the first location in the buffer). 4 .com u datasheet
SN250 functional description?application modules 63/130 sc1_rxbega [0x4480] sc1_rxenda [0x4482] sc1_rxbegb [0x4484] 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc1_rxbega sc1_rxbega 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_rxbega [12:0] dma start address (byte aligned) for receive buffer a. 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc1_rxenda sc1_rxenda 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_rxenda [12:0] dma end address (byte aligned) for receive buffer a. 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc1_rxbegb sc1_rxbegb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_rxbegb [12:0] dma start address (byte aligned) for receive buffer b. 4 .com u datasheet
functional description?application modules SN250 64/130 sc1_rxendb [0x4486] sc1_txbega [0x4488] sc1_txenda [0x448a] 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc1_rxendb sc1_rxendb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_rxendb [12:0] dma end address (byte aligned) for receive buffer b. 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc1_txbega sc1_txbega 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_txbega [12:0] dma start address (byte aligned) for transmit buffer a. 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc1_txenda sc1_txenda 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_txenda [12:0] dma end address (byte aligned) for transmit buffer a. 4 .com u datasheet
SN250 functional description?application modules 65/130 sc1_txbegb [0x448c] sc1_txendb [0x448e] sc1_rxerra [0x449a] 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc1_txbegb sc1_txbegb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_txbegb [12:0] dma start address (byte aligned) for transmit buffer b. 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc1_txendb sc1_txendb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc1_txendb [12:0] dma end address (byte aligned) for transmit buffer b. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 sc1_rxerra sc1_rxerra 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc1_rxerra [12:0] a byte offset (from 0) which points to the location of the first error in the dma receive buffer a. if there is no error, it will hold the value zero. this register will not be updated by subsequent errors arriving in the dma. the next error will only be recorded if the buffer unloads and is reloaded or the receive dma is reset. 4 .com u datasheet
functional description?application modules SN250 66/130 sc1_rxerrb [0x449c] int_sc1cfg [0x4624] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 sc1_rxerrb sc1_rxerrb 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc1_rxerrb [12:0] a byte offset (from 0) which points to the location of the first error in the dma receive buffer b. if there is no error, it will hold the value zero. this register will not be updated by subsequent errors arriving in the dma. the next error will only be recorded if the buffer unloads and is reloaded or the receive dma is reset. 15 0-r 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 int_ sc1parerr int_ sc1frmerr int_ sctxuldb int_ sctxulda int_ scrxuldb int_ scrxulda int_scnak int_ sccmdfin int_ sctxfin int_ scrxfin int_ sctxund int_ scrxovf int_ sctxidle int_ sctxfree int_ scrxval 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 int_sc1parerr [14] parity error received (uart) interrupt enable. int_sc1frmerr [13] frame error received (uart) interrupt enable. int_sctxuldb [12] dma tx buffer b unloaded interrupt enable. int_sctxulda [11] dma tx buffer a unloaded interrupt enable. int_scrxuldb [10] dma rx buffer b unloaded interrupt enable. int_scrxulda [9] dma rx buffer a unloaded interrupt enable. int_scnak [8] nack received (i 2 c) interrupt enable. int_sccmdfin [7] start/stop command complete (i 2 c) interrupt enable. int_sctxfin [6] transmit operation complete (i 2 c) interrupt enable. int_scrxfin [5] receive operation complete (i 2 c) interrupt enable. int_sctxund [4] transmit buffer underrun interrupt enable. int_scrxovf [3] receive buffer overrun interrupt enable. int_sctxidle [2] transmitter idle interrupt enable. int_sctxfree [1] transmit buffer free interrupt enable. int_scrxval [0] receive buffer has data interrupt enable. 4 .com u datasheet
SN250 functional description?application modules 67/130 int_sc1flag [0x460c] 15 0-r 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 int_ sc1parerr int_ sc1frmerr int_ sctxuldb int_ sctxulda int_ scrxuldb int_ scrxulda int_scnak int_ sccmdfin int_ sctxfin int_ scrxfin int_ sctxund int_ scrxovf int_ sctxidle int_ sctxfree int_ scrxval 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 int_sc1parerr [14] parity error received (uart) interrupt pending. int_sc1frmerr [13] frame error received (uart) interrupt pending. int_sctxuldb [12] dma tx buffer b unloaded interrupt pending. int_sctxulda [11] dma tx buffer a unloaded interrupt pending. int_scrxuldb [10] dma rx buffer b unloaded interrupt pending. int_scrxulda [9] dma rx buffer a unloaded interrupt pending. int_scnak [8] nack received (i 2 c) interrupt pending. int_sccmdfin [7] start/stop command complete (i 2 c) interrupt pending. int_sctxfin [6] transmit operation complete (i 2 c) interrupt pending. int_scrxfin [5] receive operation complete (i 2 c) interrupt pending. int_sctxund [4] transmit buffer underrun interrupt pending. int_scrxovf [3] receive buffer overrun interrupt pending. int_sctxidle [2] transmitter idle interrupt pending. int_sctxfree [1] transmit buffer free interrupt pending. int_scrxval [0] receive buffer has data interrupt pending. 4 .com u datasheet
functional description?application modules SN250 68/130 7.3 serial controller sc2 the SN250 sc2 module provides synchronous (spi or i 2 c) serial communications. figure 8 is a block diagram of the sc2 module. figure 8. sc2 block diagram the full-duplex interface of the sc2 module can be configured into one of these two communication modes, but it cannot run them simultaneously. to reduce the interrupt service requirements of the cpu, the sc2 module contains buffered data management schemes. a dedicated, buffered dma controller is available to the spi while a fifo is available to both modes. in addition, a sc2 data register allows the software application direct access to the sc2 data. finally, the sc2 routes the interface signals to gpio pins. these are shared with other functions and are controlled by the gpio_cfg register. for selecting alternate pin-functions, please refer to table 17 and ta b le 1 8 . 4 .com u datasheet
SN250 functional description?application modules 69/130 7.3.1 spi modes the spi mode of the sc2 supports both master and slave modes. it has a fixed word length of 8 bits. the sc2 spi controller is enabled with sc2_mode set to 2. the sc2 spi mode has the following features: master and slave modes full duplex operation programmable master mode clock frequency (12mhz max.) slave mode up to 5mhz bit rate programmable clock polarity and clock phase selectable data shift direction (either lsb or msb first) optional slave select input the following signals can be made available on the gpio pins: mosi (master out/slave in) miso (master in/slave out) msclk (serial clock) ssel (slave select?only in slave mode) spi master mode the sc2 spi master controller is enabled with the sc_spimst set in the sc2_spicfg register. the sc2 spi module obtains its reference clock from a programmable clock generator. clock rates are set by a clock division ratio from the 24 mhz clock: exp is written to the sc2_rateexp register and lin to the sc2_ratelin register. since the range for both values is 0 to 15, the fastest data rate is 12mbps and the slowest is 22.9bps. the sc2 spi master supports various frame formats depending upon the clock polarity ( sc_spipol ), clock phase ( sc_spipha ), and direction of data ( sc_spiord ) (see table 24 ). the register bits sc_spipol , sc_spipha , and sc_spiord are defined within the sc2_spicfg register. note: switching the spi configuration from sc_spipol=1 to sc_spipol=0 without subsequently setting sc2_mode=0 and reinitializing the spi will cause an extra byte ( 0xfe ) to be transmitted immediately before the first intended byte. rate 24 mhz 2lin1 + () 2 exp ?? ------------------------------------------------- = 4 .com u datasheet
functional description?application modules SN250 70/130 serialized sc2 spi transmit data is driven to the output pin mosi. sc2 spi master data is received from the input pin miso. to generate slave select signals to spi slave devices, other gpio pins have to be used and their assertion must be controlled by software. characters transmitted and received are passed through transmit and receive fifos. the transmit and receive fifos are 4 bytes deep. these fifos are accessed under software control by accessing the sc2_data data register or under hardware control using a dma controller. when a transmit character is written to the (empty) transmit fifo, the register bit sc_spitxidle in the sc2_spistat register clears and indicates that not all characters are transmitted yet. further transmit characters can be written to the transmit fifo until it is full, which causes the register bit sc_spitxfree in the sc2_spistat register to clear. after shifting out one transmit character to the mosi pin, space for one transmit character becomes available in the transmit fifo. this causes the register bit sc_spitxfree in the sc2_spistat register to get set. after all characters are shifted out, the transmit fifo empties, which causes the register bit sc_spitxidle in the sc2_spistat register to get set also. any character received is stored in the (empty) receive fifo. the register bit sc_spirxval in the sc2_spistat register is set to indicate that not all received characters are read out from receive fifo. if software or dma is not reading from the receive fifo, the receive fifo will store up to 4 characters. any further reception is table 24. sc2 spi master mode formats sc2_mode sc2_spicfg gpio_cfg[7:4] frame format sc_spimst sc_spiord sc_spipha sc_spipol 21000 sc2-3m mode 21001 sc2-3m mode 21010 sc2-3m mode 21011 sc2-3m mode 211 - - sc2-3m mode same as above except lsb first instead of msb first 21 - - - sc2-4s mode illegal 2 1 - - - sc2-2 mode illegal 4 .com u datasheet
SN250 functional description?application modules 71/130 dropped and the register bit sc_spirxovf in the sc2_spistat register is set. the rx fifo hardware generates the int_scrxovf interrupt, but the dma register will not indicate the error condition until the rx fifo is drained. once the dma marks a rx error, there are two conditions that will clear the error indication: setting the appropriate sc_tx/rxdmarst bit in the sc2_dmactrl register, or loading the appropriate dma buffer after it has unloaded. receiving a character always requires transmitting a character. in a case when a long stream of receive characters is expected, a long sequence of (dummy) transmit characters must be generated. to avoid software or transmit dma initiating these transfers (and consuming unnecessary bandwidth), the spi serializer can be instructed to retransmit the last transmitted character or to transmit a busy token ( 0xff ), which is determined by the register bit sc_spirpt in the sc2_spicfg register. this functionality can only be enabled (or disabled) when the transmit fifo is empty and the transmit serializer is idle, as indicated by a cleared sc_spitxidle register bit in the sc2_spistat register. every time an automatic character transmission is started, a transmit underrun is detected (as there is no data in transmit fifo) and the register bit int_sctxund in the int_sc2flag register is set. note that after disabling the automatic character transmission, the reception of new characters stops and the receive fifo holds characters just received. important: receive dma complete event does not automatically mean receive fifo empty. interrupts are generated by one of the following events: transmit fifo empty and last character shifted out (0 to 1 transition of sc_spitxidle ) transmit fifo changed from full to not full (0 to 1 transition of sc_spitxfree ) receive fifo changed from empty to not empty (0 to 1 transition of sc_spirxval ) transmit dma buffer a/b complete (1 to 0 transition of sc_txacta/b ) receive dma buffer a/b complete (1 to 0 transition of sc_rxacta/b ) received and lost character while receive fifo was full (receive overrun error) transmitted character while transmit fifo was empty (transmit underrun error) to generate interrupts to the cpu, the interrupt masks in the int_sc2cfg and int_cfg register must be enabled. spi slave mode the sc2 spi slave controller is enabled with the sc_spimst cleared in the sc2_spicfg register. the sc2 spi slave controller receives its clock from an external spi master device and supports rates up to 5mbps. the sc2 spi slave supports various frame formats depending upon the clock polarity ( sc_spipol ), clock phase ( sc_spipha ), and direction of data ( sc_spiord ) (see table 25 ). the register bits sc_spipol , sc_spipha , and sc_spiord are defined within the sc2_spicfg registers. note: switching the spi configuration from sc_spipol=1 to sc_spipol=0 without subsequently setting sc2_mode=0 and reinitializing the spi will cause an extra byte ( 0xfe ) to be transmitted immediately before the first intended byte. 4 .com u datasheet
functional description?application modules SN250 72/130 when the slave select ( ssel) signal is asserted (by the master), sc2 spi transmit data is driven to the output pin miso and sc2 spi data is received from the input pin mosi. the slave select signal ssel is used to enable driving the serialized data output signal miso. it is also used to reset the sc2 spi slave shift register. characters received and transmitted are passed through receive and transmit fifos. the transmit and receive fifos are 4 bytes deep. these fifos are accessed under software control by accessing the sc2_data data register or under hardware control using a dma controller. any character received is stored in the (empty) receive fifo. the register bit sc_spirxval in the sc2_spistat register is set to indicate that not all received characters are read out from receive fifo. if software or dma is not reading from the receive fifo, the receive fifo will store up to 4 characters. any further reception is dropped, and the register bit sc_spirxovf in the sc2_spistat register is set. the rx table 25. sc2 spi slave formats sc2_mode sc2_spicfg gpio_cfg[7:4] frame format sc_spimst sc_spiord sc_spipha sc_spipol 20000 sc2-4s mode 20001 sc2-4s mode 20010 sc2-4s mode 20011 sc2-4s mode 201 - - sc2-4s mode same as above except lsb first instead of msb first 20 - - - sc2- 3m mode illegal 20 - - - sc2-2 mode illegal 4 .com u datasheet
SN250 functional description?application modules 73/130 fifo hardware generates the int_scrxovf interrupt, but the dma register will not indicate the error condition until the rx fifo is drained. once the dma marks a rx error, there are two conditions that will clear the error indication: setting the appropriate sc_tx/rxdmarst bit in the sc2_dmactrl register, or loading the appropriate dma buffer after it has unloaded. receiving a character always causes a serialization of a transmit character pulled from the transmit fifo. when the transmit fifo is empty, a transmit underrun is detected (no data in transmit fifo) and the register bit int_sctxund in the int_sc2flag register is set. because there is no character available for serialization, the spi serializer retransmits the last transmitted character or a busy token ( 0xff ), which is determined by the register bit sc_spirpt in the sc2_spicfg register. when a transmit character is written to the (empty) transmit fifo, the register bit sc_spitxidle in the sc2_spistat register clears and indicates that not all characters are transmitted yet. further transmit characters can be written to the transmit fifo until it is full, which causes the register bit sc_spitxfree in the sc2_spistat register to clear. after shifting one transmit character to the miso pin, space for one transmit character becomes available in the transmit fifo. this causes the register bit sc_spitxfree in the sc2_spistat register to be set. after all characters are shifted out, the transmit fifo is empty, which causes the register bit sc_spitxidle in the sc2_spistat register to get set also. interrupts are generated by one of the following events: transmit fifo empty and last character shifted out (0 to 1 transition of sc_spitxidle ) transmit fifo changed from full to not full (0 to 1 transition of sc_spitxfree ) receive fifo changed from empty to not empty (0 to 1 transition of sc_spirxval ) transmit dma buffer a/b complete (1 to 0 transition of sc_txacta/b ) receive dma buffer a/b complete (1 to 0 transition of sc_rxacta/b ) received and lost character while receive fifo was full (receive overrun error) transmitted character while transmit fifo was empty (transmit underrun error) to generate interrupts to the cpu, the interrupt masks in the int_sc2cfg and int_cfg register must be enabled. 7.3.2 i 2 c master mode the sc2 i 2 c controller is only available in master mode. the sc2 i 2 c controller is enabled with sc2_mode set to 3. the i 2 c master controller supports standard (100kbps) and fast (400kbps) i 2 c modes. address arbitration is not implemented, so multiple master applications are not supported. the i 2 c signals are pure open-collector signals, and external pull-up resistors are required. the sc2 i 2 c mode has the following features: programmable clock frequency (400khz max.) 7- and 10-bit addressing the following signals can be made available on the gpio pins: sda (serial data) scl (serial clock) 4 .com u datasheet
functional description?application modules SN250 74/130 the i 2 c master controller obtains its reference clock from a programmable clock generator. clock rates are set by a clock division ratio from the 24mhz clock: exp is written to the sc2_rateexp register and lin to the sc2_ratelin register. table 26 shows the rate settings for standard i 2 c (100kbps) and fast i 2 c (400kbps) operation. note that, at 400kbps, the i 2 c specification requires the minimum low period of scl to be 1.3s. to be strictly i 2 c compliant, the rate needs to be lowered to 375kbps. the i 2 c master controller supports generation of various frame segments defined by the register bits sc_i2cstart , sc_i2cstop , sc_i2csend , and sc_i2crecv within the sc2_i2cctrl1 register. ta b le 2 7 summarizes these frames. full i 2 c frames have to be constructed under software control by generating individual i 2 c segments. all necessary segment transitions are shown in figure 7 . ack or nack generation of an i 2 c receive frame segment is determined with the register bit sc_i2cack in the sc2_i2cctrl2 register. generation of a 7-bit address is accomplished with one transmit segment. the upper 7 bits of the transmitted character contain the 7-bit address. the remaining lower bit contains the command type (?read? or ?write?). generation of a 10-bit address is accomplished with two transmit segments. the upper 5 bits of the first transmit character must be set to 0x1e . the next 2 bits are for the 2 most significant bits of the 10-bit address. the remaining lower bit contains the command type (?read? or ?write?). the second transmit segment is for the remaining 8 bits of the 10-bit address. table 26. i 2 c nominal rate programming nominal rate sppr spr 100kbps 14 3 375kpbs 15 1 400kbps 14 1 nominal rate 24mhz 2lin1 + () 2 exp ?? ------------------------------------------------- = 4 .com u datasheet
SN250 functional description?application modules 75/130 table 27. i 2 c master segment formats sc2_mode sc2_i2cctr l1 gpio_cfg[7:4] frame segments sc_i2cstart sc_i2csend sc_i2crecv sc_i2cstop 3 1 0 0 0 sc2-2 mode 30100 sc2-2 mode 30010 sc2-2 mode 30001 sc2-2 mode 3 0 0 0 0 sc2-2 mode no pending frame segment 31 - - 1 1 1 - - - 1 1 - - - 1 1 sc2-2 mode illegal 3 - - - - sc2-4m mode illegal 3 - - - - sc2-4a mode illegal 4 .com u datasheet
functional description?application modules SN250 76/130 characters received and transmitted are passed through receive and transmit fifos. the sc2 i 2 c master transmit and receive fifos are 1 byte deep. these fifos are accessed under software control. (re)start and stop segments are initiated by setting the register bits sc_i2cstart or sc_i2cstop in the sc2_i2cctrl1 register, followed by waiting until they have cleared. alternatively, the register bit sc_i2ccmdfin in the sc2_i2cstat can be used for waiting. for initiating a transmit segment, the data has to be written to the sc2_data data register, followed by setting the register bit sc_i2csend in the sc2_i2cctrl1 register, and completed by waiting until it clears. alternatively, the register bit sc_i2ctxfin in the sc2_i2cstat can be used for waiting. a receive segment is initiated by setting the register bit sc_i2crecv in the sc2_i2cctrl1 register, waiting until it clears, and then reading from the sc2_data data register. alternatively, the register bit sc_i2crxfin in the sc2_i2cstat can be used for waiting. now the register bit sc_i2crxnak in the sc2_i2cstat register indicates if a nack or ack was received from an i 2 c slave device. interrupts are generated on the following events: bus command ( sc_i2cstart / sc_i2cstop ) completed (0 to 1 transition of sc_i2ccmdfin ) character transmitted and slave device responded with nack character transmitted (0 to 1 transition of sc_i2ctxfin ) character received (0 to 1 transition of sc_i2crxfin ) received and lost character while receive fifo was full (receive overrun error) transmitted character while transmit fifo was empty (transmit underrun error) to generate interrupts to the cpu, the interrupt masks in the int_sc2cfg and int_cfg register must be enabled. 4 .com u datasheet
SN250 functional description?application modules 77/130 7.3.3 registers sc2_mode [0x442a] sc2_data [0x441e] sc2_ratelin [0x4430] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0sc2_mode 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-rw 1 0-rw 0 sc2_mode [1:0] sc2 mode: 0 = disabled; 1 = disabled; 2 = spi mode; 3 = i 2 c mode. note: to change between modes, the previous mode must be disabled first. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 sc2_data 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_data [7:0] transmit and receive data register. writing to this register pushes a byte onto the transmit fifo. reading from this register pulls a byte from the receive fifo. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc2_ratelin 0-r 7 0-r 6 0-r 5 0-r 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_ratelin [3:0] the linear component (lin) of the clock rate as seen in the equation: rate 24 mhz 2lin1 + () 2 exp ?? ------------------------------------------------- = 4 .com u datasheet
functional description?application modules SN250 78/130 sc2_rateexp [0x4432] sc2_spicfg [0x442c] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc2_rateexp 0-r 7 0-r 6 0-r 5 0-r 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_rateexp [3:0] the exponential component (exp) of the clock rate as seen in the equation: 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 sc_ spirxdrv sc_spims t sc_spirp t sc_spior d sc_spiph a sc_spipo l 0-r 7 0-r 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc_spirxdrv [5] receiver-driven mode selection bit (spi master mode only). clearing this bit will initiate transactions when transmit data is available. setting this bit will initiate transactions when the receive buffer (fifo or dma) has space. sc_spimst [4] setting this bit will put the spi in master mode while clearing this bit will put the spi in slave mode. sc_spirpt [3] this bit controls behavior on a transmit buffer underrun condition in slave mode. clearing this bit will send the busy token (0xff) and setting this bit will repeat the last byte. changing this bit will only take effect when the transmit fifo is empty and the transmit serializer is idle. sc_spiord [2] clearing this bit will result in the most significant bit being transmitted first while setting this bit will result in the least significant bit being transmitted first. sc_spipha [1] clock phase configuration is selected with clearing this bit for sampling on the leading (first edge) and setting this bit for sampling on second edge. sc_spipol [0] clock polarity configuration is selected with clearing this bit for a rising leading edge and setting this bit for a falling leading edge. rate 24 mhz 2lin1 + () 2 exp ?? ------------------------------------------------- = 4 .com u datasheet
SN250 functional description?application modules 79/130 sc2_spistat [0x4420] sc2_i2cctrl1 [0x4426] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc_ spitxidle sc_ spitxfree sc_ spirxval sc_ spirxovf 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc_spitxidle [3] this bit is set when the transmit fifo is empty and the transmitter is idle. sc_spitxfree [2] this bit is set when the transmit fifo is ready to accept at least one byte. sc_spirxval [1] this bit is set when the receive fifo contains at least one byte. sc_spirxovf [0] this bit is set when the receive fifo has been overrun. this bit clears when the data register ( sc2_data ) is read. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc_ i2cstop sc_ i2cstart sc_ i2csend sc_ i2crecv 0-r 7 0-r 6 0-r 5 0-r 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc_i2cstop [3] setting this bit sends the stop command. it autoclears when the command completes. sc_i2cstart [2] setting this bit sends the start or repeated start command. it autoclears when the command completes. sc_i2csend [1] setting this bit transmits a byte. it autoclears when the command completes. sc_i2crecv [0] setting this bit receives a byte. it autoclears when the command completes. 4 .com u datasheet
functional description?application modules SN250 80/130 sc2_i2cctrl2 [0x4428] sc2_i2cstat [0x4422] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sc_i2cac k 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-rw 0 sc_i2cack [0] setting this bit will signal ack after a received byte. clearing this bit will signal nack after a received byte. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 sc_ i2ccmdfin sc_ i2crxfin sc_ i2ctxfin sc_ i2crxnak 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc_i2ccmdfin [3] this bit is set when a start or stop command completes. it autoclears on next bus activity. sc_i2crxfin [2] this bit is set when a byte is received. it autoclears on next bus activity. sc_i2ctxfin [1] this bit is set when a byte is transmitted. it autoclears on next bus activity. sc_i2crxnak [0] this bit is set when a nack is received from the slave. it autoclears on next bus activity. 4 .com u datasheet
SN250 functional description?application modules 81/130 sc2_dmactrl [0x4418] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 sc_ txdmarst sc_ rxdmars t sc_txlod b sc_txlod a sc_rxlod b sc_rxlod a 0-r 7 0-r 6 0-w 5 0-w 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc_txdmarst [5] setting this bit will reset the transmit dma. the bit is autocleared. sc_rxdmarst [4] setting this bit will reset the receive dma. this bit is autocleared. sc_txlodb [3] setting this bit loads dma transmit buffer b addresses and starts the dma controller processing transmit buffer b. this bit is autocleared when dma completes. writing a zero to this bit will not have any effect. reading this bit as one indicates dma processing for buffer b is active or pending. reading this bit as zero indicates dma processing for buffer b is complete or idle. sc_txloda [2] setting this bit loads dma transmit buffer a addresses and starts the dma controller processing transmit buffer a. this bit is autocleared when dma completes. writing a zero to this bit will not have any effect. reading this bit as one indicates dma processing for buffer a is active or pending. reading this bit as zero indicates dma processing for buffer a is complete or idle. sc_rxlodb [1] setting this bit loads dma receive buffer b addresses and starts the dma controller processing receive buffer b. this bit is autocleared when dma completes. writing a zero to this bit will not have any effect. reading this bit as one indicates dma processing for buffer b is active or pending. reading this bit as zero indicates dma processing for buffer b is complete or idle. sc_rxloda [0] setting this bit loads dma receive buffer a addresses and starts the dma controller processing receive buffer a. this bit is autocleared when dma completes. writing a zero to this bit will not have any effect. reading this bit as one indicates dma processing for buffer a is active or pending. reading this bit as zero indicates dma processing for buffer a is complete or idle. 4 .com u datasheet
functional description?application modules SN250 82/130 sc2_dmastat [0x4416] sc2_rxcnta [0x4410] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 sc_rxovfb sc_rxovfa sc_txactb sc_txacta sc_rxactb sc_rxacta 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc_rxovfb [5] this bit is set when dma receive buffer b was passed an overrun error from the lower hardware fifo. neither receive buffers were capable of accepting any more bytes (unloaded), and the fifo filled up. buffer b was the next buffer to load, and when it drained the fifo the overrun error was passed up to the dma and flagged with this bit. this bit is autocleared the next time buffer b is loaded or when the receive dma is reset. sc_rxovfa [4] this bit is set when dma receive buffer a was passed an overrun error from the lower hardware fifo. neither receive buffers were capable of accepting any more bytes (unloaded), and the fifo filled up. buffer a was the next buffer to load, and when it drained the fifo the overrun error was passed up to the dma and flagged with this bit. this bit is autocleared the next time buffer a is loaded or when the receive dma is reset. sc_txactb [3] this bit is set when dma transmit buffer b is currently active. sc_txacta [2] this bit is set when dma transmit buffer a is currently active. sc_rxactb [1] this bit is set when dma receive buffer b is currently active. sc_rxacta [0] this bit is set when dma receive buffer a is currently active. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 sc2_rxcnta sc2_rxcnta 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc2_rxcnta [12:0] a byte offset (from 0) which points to the location in dma receive buffer a where the next byte will be placed. when the buffer fills and subsequently unloads, this register wraps around and holds the value zero (pointing back to the first location in the buffer). 4 .com u datasheet
SN250 functional description?application modules 83/130 sc2_rxcntb [0x4412] sc2_txcnt [0x4414] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 sc2_rxcntb sc2_rxcntb 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc2_rxcntb [12:0] a byte offset (from 0) which points to the location in dma receive buffer b where the next byte will be placed. when the buffer fills and subsequently unloads, this register wraps around and holds the value zero (pointing back to the first location in the buffer). 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 sc2_txcnt sc2_txcnt 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc2_txcnt [12:0] a byte offset (from 0) which points to the location in the active (loaded) dma transmit buffer where the next byte will be placed. when the buffer fills and subsequently unloads, this register wraps around and holds the value zero (pointing back to the first location in the buffer). 4 .com u datasheet
functional description?application modules SN250 84/130 sc2_rxbega [0x4400] sc2_rxenda [0x4402] 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc2_rxbega sc2_rxbega 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_rxbega [12:0] dma start address (byte aligned) for receive buffer a. 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc2_rxenda sc2_rxenda 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_rxenda [12:0] dma end address (byte aligned) for receive buffer a. 4 .com u datasheet
SN250 functional description?application modules 85/130 sc2_rxbegb [0x4404] sc2_rxendb [0x4406] sc2_txbega [0x4408] 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc2_rxbegb sc2_rxbegb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_rxbegb [12:0] dma start address (byte aligned) for receive buffer b. 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc2_rxendb sc2_rxendb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_rxendb [12:0] dma end address (byte aligned) for receive buffer b. 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc2_txbega sc2_txbega 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_txbega [12:0] dma start address (byte aligned) for transmit buffer a. 4 .com u datasheet
functional description?application modules SN250 86/130 sc2_txenda [0x440a] sc2_txbegb [0x440c] 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc2_txenda sc2_txenda 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_txenda [12:0] dma end address (byte aligned) for transmit buffer a. 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc2_txbegb sc2_txbegb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_txbegb [12:0] dma start address (byte aligned) for transmit buffer b. 4 .com u datasheet
SN250 functional description?application modules 87/130 sc2_txendb [0x440e] sc2_rxerra [0x441a] sc2_rxerrb [0x441c] 15 0-r 14 1-r 13 1-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 1 1 sc2_txendb sc2_txendb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 sc2_txendb [12:0] dma end address (byte aligned) for transmit buffer b.            
  



 
 
 
 
 sc2_rxerra [12:0] a byte offset (from 0) which points to the location of the first error in the dma receive buffer a. if there is no error, it will hold the value zero. this register will not be updated by subsequent errors arriving in the dma. the next error will only be recorded if the buffer unloads and is reloaded or the receive dma is reset. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 sc2_rxerrb sc2_rxerrb 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 sc2_rxerrb [12:0] a byte offset (from 0) which points to the location of the first error in the dma receive buffer b. if there is no error, it will hold the value zero. this register will not be updated by subsequent errors arriving in the dma. the next error will only be recorded if the buffer unloads and is reloaded or the receive dma is reset. 4 .com u datasheet
functional description?application modules SN250 88/130 int_sc2cfg [0x4626] 15 0-r 14 0-r 13 0-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 0 0 int_ sctxuldb int_ sctxulda int_ scrxuldb int_ scrxulda int_scna k int_ sccmdfin int_ sctxfin int_ scrxfin int_ sctxund int_ scrxovf int_ sctxidle int_ sctxfree int_ scrxval 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 int_sctxuldb [12] dma tx buffer b unloaded interrupt enable. int_sctxulda [11] dma tx buffer a unloaded interrupt enable. int_scrxuldb [10] dma rx buffer b unloaded interrupt enable. int_scrxulda [9] dma rx buffer a unloaded interrupt enable. int_scnak [8] nack received (i 2 c) interrupt enable. int_sccmdfin [7] start/stop command complete (i 2 c) interrupt enable. int_sctxfin [6] transmit operation complete (i 2 c) interrupt enable. int_scrxfin [5] receive operation complete (i 2 c) interrupt enable. int_sctxund [4] transmit buffer underrun interrupt enable. int_scrxovf [3] receive buffer overrun interrupt enable. int_sctxidle [2] transmitter idle interrupt enable. int_sctxfree [1] transmit buffer free interrupt enable. int_scrxval [0] receive buffer has data interrupt enable. 4 .com u datasheet
SN250 functional description?application modules 89/130 int_sc2flag [0x460e] 15 0-r 14 0-r 13 0-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 0 0 int_ sctxuldb int_ sctxulda int_ scrxuldb int_ scrxulda int_scnak int_ sccmdfin int_ sctxfin int_ scrxfin int_ sctxund int_ scrxovf int_ sctxidle int_ sctxfree int_ scrxval 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 int_sctxuldb [12] dma tx buffer b unloaded interrupt pending. int_sctxulda [11] dma tx buffer a unloaded interrupt pending. int_scrxuldb [10] dma rx buffer b unloaded interrupt pending. int_scrxulda [9] dma rx buffer a unloaded interrupt pending. int_scnak [8] nack received (i 2 c) interrupt pending. int_sccmdfin [7] start/stop command complete (i 2 c) interrupt pending. int_sctxfin [6] transmit operation complete (i 2 c) interrupt pending. int_scrxfin [5] receive operation complete (i 2 c) interrupt pending. int_sctxund [4] transmit buffer underrun interrupt pending. int_scrxovf [3] receive buffer overrun interrupt pending. int_sctxidle [2] transmitter idle interrupt pending. int_sctxfree [1] transmit buffer free interrupt pending. int_scrxval [0] receive buffer has data interrupt pending. 4 .com u datasheet
functional description?application modules SN250 90/130 7.4 general purpose timers the SN250 integrates two general-purpose, 16-bit timers?tmr1 and tmr2. each of the two timers contains the following features: configurable clock source counter load two output compare registers two input capture registers can be configured to do pwm up/down counting (for pwm motor drive phase correction) single shot operation mode (timer stops at zero or threshold) figure 9 is a block diagram of the timer tmr1 module. timer tmr2 is identical. figure 9. timer tmr1 block diagram 7.4.1 clock sources the clock source for each timer can be chosen from the main 12mhz clock, 32.768khz clock, 1khz rc-clock, or from an external source (up to 100khz) through tmr1clk or tmr2clk. after choosing the clock source (see ta b le 2 8 ), the frequency can be further divided to generate the final timer cycle provided to the timer controller (see ta b le 2 9 ). in addition, the clock edge (either rising or falling) for this timer clock can be selected (see table 30 ). 4 .com u datasheet
SN250 functional description?application modules 91/130 note: all configuration changes do not take effect until the next edge of the timer?s clock source. these functions are separately controlled for tmr1 and tmr2 by setting the bits tmr_clk , tmr_filt , tmr_edge , and tmr_pscl in the timer registers tmr1_cfg and tmr2_cfg , respectively. 7.4.2 timer functionality (counting) each timer supports three counting modes: increasing, decreasing, or alternating (where the counting will increase, then decrease, then increase). these modes are controlled by setting the tmr_down and tmr_bidir bits within the tmr1_cfg or tmr2_cfg registers. upward counting continues until the counter value reaches the threshold value stored in the tmr1_top or tmr2_top register. downward counting continues until the counter value reaches the value zero. when the alternating counting mode is enabled, a triangular-shaped waveform of the count-value can be created. figure 10 through figure 13 illustrate the different counting modes available from the timers. counting can be enabled and disabled with the register bit tmr_en in the tmr1_cfg or tmr2_cfg registers. when the timer is disabled, the counter stops counting and maintains its count value. enabling can be masked with the pin tmr1enmsk or tmr2enmsk, depending on register bit tmr_exten in the tmr1_cfg or tmr2_cfg registers. by default, the counting operation is repetitive. it can be restricted to single counting enabled with the register bit tmr_1shot located in the tmr1_cfg or tmr2_cfg registers. table 28. tmr1 and tmr2 clock source settings tmr_clk[1:0] clock source 0 1 khz rc clock 1 32.768khz clock 2 12 mhz clock 3 gpio clock input table 29. clock source divider settings tmr_pscl[3:0] clock source prescale factor n = 0..10 2 n n = 11..15 2 10 table 30. clock edge setting tmr_edge clock source 0 rising 1 falling 4 .com u datasheet
functional description?application modules SN250 92/130 figure 10. timer counting mode?saw tooth, up 4 .com u datasheet
SN250 functional description?application modules 93/130 figure 11. timer counting mode?saw tooth, down 4 .com u datasheet
functional description?application modules SN250 94/130 figure 12. timer counting mode?alternating, initially up 4 .com u datasheet
SN250 functional description?application modules 95/130 figure 13. timer counting mode?alternating, initially down 4 .com u datasheet
functional description?application modules SN250 96/130 7.4.3 timer functionality (output compare) there are two output signals from each timer to generate application-specific waveforms. these waveforms are generated or altered by comparison results with the timer count value. there are four comparison results: counter value reaches zero. counter value reaches threshold value of tmr1_top or tmr2_top register. counter value reaches comparison value of tmr1_cmpa or tmr2_cmpa register. counter value reaches comparison value of tmr1_cmpb or tmr2_cmpb register. the output waveform generation from each timer is controlled with the register bits ( tmr_cmpmod or inverted with tmr_cmpinv ) in the tmr1_cmpcfga , tmr1_cmpcfgb , tmr2_cmpcfga , and tmr2_cmpcfgb registers. table 31 summarizes the output waveform generation modes. the output signals tmr1oa and tmr1ob from timer 1, and tmr2oa and tmr2ob from timer 2, are available on gpio. for selecting alternate pin functions, refer to table 17 and table 18 . figure 14 and figure 15 show examples of all timer output generation modes. table 31. output waveform settings tmr_cmpmod[3:0] output waveform generation mode 0 disable alteration 1 toggle on count = top 2 set on count = top, clear on count = cmpa 3 set on count = top, clear on count = cmpb 4 set to 1 5 set on count = cmpa, clear on count = top 6 toggle on count = cmpa 7 set on count = cmpa, clear on count = cmpb 8 clear to 0 9 set on count = cmpb, clear on count = top 10 set on count = cmpb, clear on count = cmpa 11 toggle on count = cmpb 12 toggle on count = zero 13 set on count = zero, clear on count = top 14 set on count = zero, clear on count = cmpa 15 set on count = zero, clear on count = cmpb 4 .com u datasheet
SN250 functional description?application modules 97/130 figure 14. timer output generation mode example?saw tooth, non-inverting figure 15. timer output generation mode example?alternating, non-inverting 4 .com u datasheet
functional description?application modules SN250 98/130 7.4.4 timer functionality (input capture) there are two capture registers that store the timer count value on a trigger condition from gpio signals. the timer trigger signals tmr1ia and tmr1ib for timer 1, and tmr2ia and tmr2ib for timer 2 are provided by external signals routed to the gpio pins. these timer trigger signals are synchronized to the main 12mhz clock, passed to an optional glitch filter, and followed by an edge detection circuitry. these functions are controlled by software with the register bits tmr_capmod[1:0] , and tmr_capfilt in the tmr1_capcfga , tmr1_capcfgb , tmr2_capcfga , and tmr2_capcfgb registers. all glitch filters consist of a flip-flop-driven, 4-bit shift register clocked with the main 12mhz clock. 7.4.5 timer interrupt sources each timer supports a number of interrupts sources: on overflow during up-count from all 1s to zero. on counter reaching output compare values stored in the tmr1_cmpa , tmr1_cmpb or tmr2_cmpa , and tmr2_cmpb registers. on counter reaching zero, tmr1_top , or tmr2_top . on capturing events from gpio. to generate interrupts to the cpu, the interrupt masks in the int_tmrcfg and int_cfg registers must be enabled. table 32. gpio/timer trigger conditioning tmr_capmod[1:0] detection mode 0 disabled 1 rising edge 2 falling edge 3 either edge 4 .com u datasheet
SN250 functional description?application modules 99/130 7.4.6 registers tmr1_cfg [0x450c] tmr1_cnt [0x4500] 15 0-r 14 0-r 13 0-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 0 0 tmr_exten tmr_en tmr_bidir tmr_down tmr_1shot tmr_pscl tmr_filt tmr_edge tmr_clk 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr_exten [12] control bit for the external enable mask on a pin. when this bit is clear, do not check status of the tmr1enmsk pin. when this bit is set, check status of the tmr1enmsk pin. tmr_en [11] set this bit to enable counting. to change other register bits, this bit must be cleared. tmr_bidir [10] set this bit to enable bi-directional alternation mode. tmr_down [9] initial count direction after enabling the timer. clear this bit to count up; set this bit to count down. tmr_1shot [8] clear this bit for auto repetition mode. set this bit for a single shot. tmr_pscl [7:4] clock divider setting (n). the possible clock divisors are: 0 ? 2 n (n = 0..10). tmr_filt [3] set this bit to enable clock source glitch filtering. tmr_edge [2] clock source edge selection. clear this bit for rising edge; set this bit for falling edge. tmr_clk [1:0] clock source selection: 0 = calibrated rc oscillator (default);1 = 32khz; 2 = 12mhz; 3 = external (gpio). 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw tmr1_cnt tmr1_cnt 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr1_cnt [15:0] current timer 1 counter value. when read, returns the current timer counter. when written, overwrites the timer counter and restarts wrap detection. 4 .com u datasheet
functional description?application modules SN250 100/130 tmr1_top [0x4506] tmr1_cmpcfga [0x450e] tmr1_cmpcfgb [0x4510] 15 1-rw 14 1-rw 13 1-rw 12 1-rw 11 1-rw 10 1-rw 9 1-rw 8 1-rw tmr1_top tmr1_top 1-rw 7 1-rw 6 1-rw 5 1-rw 4 1-rw 3 1-rw 2 1-rw 1 1-rw 0 tmr1_top [15:0] timer 1 threshold value. 15 0-rw 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r tmr_cmpen 0 0 0 0 0 0 0 0 0 0 tmr_ cmpinv tmr_cmpmod 0-r 7 0-r 6 0-r 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr_cmpen [15] set this bit to enable output a. tmr_cmpinv [4] set this bit to invert output a. tmr_cmpmod [3:0] output mode selection bits. refer to table 31 for the modes. 15 0-rw 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r tmr_cmpen 0 0 0 0 0 0 0 0 0 0 tmr_ cmpinv tmr_cmpmod 0-r 7 0-r 6 0-r 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr_cmpen [15] set this bit to enable output b. tmr_cmpinv [4] set this bit to invert output b. tmr_cmpmod [3:0] output mode selection bits. refer to table 31 for the modes . 4 .com u datasheet
SN250 functional description?application modules 101/130 tmr1_cmpa [0x4508] tmr1_cmpb [0x450a] tmr1_capcfga [0x4512] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r tmr_cmpen 0 0 0 0 0 0 0 0 0 0 tmr_ cmpinv tmr_cmpmod 0-r 7 0-r 6 0-r 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr1_cmpa [15:0] timer 1 compare a value. 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw tmr1_cmpb tmr1_cmpb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr1_cmpb [15:0] timer 1 compare b value. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-rw 0 0 0 0 0 0 0 tmr_ capfilt 0 tmr_capmod 0 0 0 0 0 0-r 7 0-rw 6 0-rw 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 tmr_capfilt [8] set this bit to enable the input a filter. tmr_capmod [6:5] input edge triggering selection: 0 = disabled; 1 = rising; 2 = falling; 3 = both edges. 4 .com u datasheet
functional description?application modules SN250 102/130 tmr1_capcfgb [0x4514] tmr1_capa [0x4502] tmr1_capb [0x4504] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-rw 0 0 0 0 0 0 0 tmr_ capfilt 0 tmr_capmod 0 0 0 0 0 0-r 7 0-rw 6 0-rw 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 tmr_capfilt [8] set this bit to enable the input b filter. tmr_capmod [6:5] input edge triggering selection: 0 = disabled; 1 = rising; 2 = falling; 3 = both edges. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r tmr1_capa tmr1_capa 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 tmr1_capa [15:0] timer 1 capture a value. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r tmr1_capb tmr1_capb 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 tmr1_capb [15:0] timer 1 capture b value. 4 .com u datasheet
SN250 functional description?application modules 103/130 tmr2_cfg [0x458c] tmr2_cnt [0x4580] 15 0-r 14 0-r 13 0-r 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 0 0 tmr_exten tmr_en tmr_bidir tmr_down tmr_1shot tmr_pscl tmr_filt tmr_edge tmr_clk 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr_exten [12] control bit for the external enable mask on a pin. when this bit is clear, do not check status of the tmr2enmsk pin. when this bit is set, check status of the tmr2enmsk pin. tmr_en [11] set this bit to enable counting. to change other register bits, this bit must be cleared. tmr_bidir [10] set this bit to enable bi-directional alternation mode. tmr_down [9] initial count direction after enabling the timer. clear this bit to count up; set this bit to count down. tmr_1shot [8] clear this bit for auto repetition mode. set this bit for a single shot. tmr_pscl [7:4] clock divider setting (n). the possible clock divisors are: 0 ? 2 n (n = 0..10). tmr_filt [3] set this bit to enable clock source glitch filtering. tmr_edge [2] clock source edge selection. clear this bit for rising edge; set this bit for falling edge. tmr_clk [1:0] clock source selection: 0 = calibrated rc oscillator (default); 1 = 32khz; 2 = 12mhz; 3 = external (gpio). 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw tmr2_cnt tmr2_cnt 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr2_cnt [15:0] current timer 2 counter value. when read, returns the current timer counter. when written, overwrites the timer counter and restarts wrap detection. 4 .com u datasheet
functional description?application modules SN250 104/130 tmr2_top [0x4586] tmr2_cmpcfga [0x458e] tmr2_cmpcfgb [0x4590] 15 1-rw 14 1-rw 13 1-rw 12 1-rw 11 1-rw 10 1-rw 9 1-rw 8 1-rw tmr2_top tmr2_top 1-rw 7 1-rw 6 1-rw 5 1-rw 4 1-rw 3 1-rw 2 1-rw 1 1-rw 0 tmr2_top [15:0] timer 2 threshold value. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r tmr_cmpen 0 0 0 0 0 0 0 0 0 0 tmr_ cmpinv tmr_cmpmod 0-r 7 0-r 6 0-r 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr_cmpen [15] set this bit to enable output a. tmr_cmpinv [4] set this bit to invert output a. tmr_cmpmod [3:0] output mode selection bits. refer to table 31 for the modes. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r tmr_cmpen 0 0 0 0 0 0 0 0 0 0 tmr_ cmpinv tmr_cmpmod 0-r 7 0-r 6 0-r 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr_cmpen [15] set this bit to enable output b. tmr_cmpinv [4] set this bit to invert output b. tmr_cmpmod [3:0] output mode selection bits. refer to table 31 for the modes. 4 .com u datasheet
SN250 functional description?application modules 105/130 tmr2_cmpa [0x4588] tmr2_cmpb [0x458a] tmr2_capcfga [0x4592] 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw tmr2_cmpa tmr2_cmpa 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr2_cmpa [15:0] timer 2 compare a value. 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw tmr2_cmpb tmr2_cmpb 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 tmr2_cmpb [15:0] timer 2 compare b value. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-rw 0 0 0 0 0 0 0 tmr_ capfilt 0 tmr_capmod 0 0 0 0 0 0-r 7 0-rw 6 0-rw 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 tmr_capfilt [8] set this bit to enable the input a filter. tmr_capmod [6:5] input edge triggering selection: 0 = disabled; 1 = rising; 2 = falling; 3 = both edges. 4 .com u datasheet
functional description?application modules SN250 106/130 tmr2_capcfgb [0x4594] tmr2_capa [0x4582] tmr2_capb [0x4584] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-rw 0 0 0 0 0 0 0 tmr_ capfilt 0 tmr_capmod 0 0 0 0 0 0-r 7 0-rw 6 0-rw 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 tmr_capfilt [8] set this bit to enable the input a filter. tmr_capmod [6:5] input edge triggering selection: 0 = disabled; 1 = rising; 2 = falling; 3 = both edges. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r tmr2_capa tmr2_capa 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 tmr2_capa [15:0] timer 2 capture value.            
                  tmr2_capb [15:0] timer 2 capture value. 4 .com u datasheet
SN250 functional description?application modules 107/130 int_tmrcfg [0x462c] 15 0-r 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 int_ tmr2capb int_ tmr2capa int_ tmr2cmptop int_ tmr2cmpz int_ tmr2cmpb int_ tmr2cmpa int_ tmr2wrap 0 int_ tmr1capb int_ tmr1capa int_ tmr1cmptop int_ tmr1cmpz int_ tmr1cmpb int_ tmr1cmpa int_ tmr1wrap 0-r 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 int_tmr2capb [14] timer 2 capture b interrupt enable. int_tmr2capa [13] timer 2 capture a interrupt enable. int_tmr2cmptop [12] timer 2 compare top interrupt enable. int_tmr2cmpz [11] timer 2 compare zero interrupt enable. int_tmr2cmpb [10] timer 2 compare b interrupt enable. int_tmr2cmpa [9] timer 2 compare a interrupt enable. int_tmr2wrap [8] timer 2 overflow interrupt enable. int_tmr1capb [6] timer 1 capture b interrupt enable. int_tmr1capa [5] timer 1 capture a interrupt enable. int_tmr1cmptop [4] timer 1 compare top interrupt enable. int_tmr1cmpz [3] timer 1 compare zero interrupt enable. int_tmr1cmpb [2] timer 1 compare b interrupt enable. int_tmr1cmpa [1] timer 1 compare a interrupt enable. int_tmr1wrap [0] timer 1 overflow interrupt enable. 4 .com u datasheet
functional description?application modules SN250 108/130 int_tmrflag [0x4614] 15 0-r 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 int_ tmr2capb int_ tmr2capa int_ tmr2cmptop int_ tmr2cmpz int_ tmr2cmpb int_ tmr2cmpa int_ tmr2wrap 0 int_ tmr1capb int_ tmr1capa int_ tmr1cmptop int_ tmr1cmpz int_ tmr1cmpb int_ tmr1cmpa int_ tmr1wrap 0-r 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 int_tmr2capb [14] timer 2 capture b interrupt pending. int_tmr2capa [13] timer 2 capture a interrupt pending. int_tmr2cmptop [12] timer 2 compare top interrupt pending. int_tmr2cmpz [11] timer 2 compare zero interrupt pending. int_tmr2cmpb [10] timer 2 compare b interrupt pending. int_tmr2cmpa [9] timer 2 compare a interrupt pending. int_tmr2wrap [8] timer 2 overflow interrupt pending. int_tmr1capb [6] timer 1 capture b interrupt pending. int_tmr1capa [5] timer 1 capture a interrupt pending. int_tmr1cmptop [4] timer 1 compare top interrupt pending. int_tmr1cmpz [3] timer 1 compare zero interrupt pending. int_tmr1cmpb [2] timer 1 compare b interrupt pending. int_tmr1cmpa [1] timer 1 compare a interrupt pending. int_tmr1wrap [0] timer 1 overflow interrupt pending. 4 .com u datasheet
SN250 functional description?application modules 109/130 7.5 adc module the adc is a first-order sigma-delta converter sampling at 1mhz with programmable resolution and conversion rate. the conversion rate is programmed by setting the adc_rate bits in the adc_cfg register. the analog input of the adc can be chosen from various sources and is configured with the adc_sel bits in the adc_cfg register. as described in table 34 , the adc inputs can be single-ended (routed individually to adc0, adc1, adc2, or adc3) or differential (routed to pairs adc0-adc1 and adc2-adc3). for selecting alternate pin functions, refer to table 17 and table 18 . setting the adc_en bit in the adc_cfg register will c ause the adc to immediately begin conversions. the adc will continually generate conversions until the adc_en bit is cleared. when each conversion completes, an int_adc interrupt is generated. in order for this to interrupt the cpu the interrupt mask int_adc must be enabled in the int_cfg register. the int_adc interrupt is the only means for determining when a conversion completes. after each int_adc interrupt, the int_adc interrupt bit must be cleared to detect completion of the next conversion. table 33. adc conversion rate adc_rate[2:0] conversion time equivalent adc bits 032 s 5, located in adc_data[15:11] 164 s 6, located in adc_data[15:10] 2 128 s 7, located in adc_data[15:9] 3 256 s 8, located in adc_data[15:8] 4 512 s 9, located in adc_data[15:7] 5 1024 s 10, located in adc_data[15:6] 6 2048 s 11, located in adc_data[15:5] 7 4096 s 12, located in adc_data[15:4] table 34. adc inputs adc_sel[3:0] analog source of adc gpio pin purpose 0 adc0 4 single-ended 1 adc1 5 single-ended 2 adc2 6 single-ended 3 adc3 7 single-ended 4 (1/4) * vdd_pads (2.1?3.6v pad supply) supply monitoring 5 (1/2) * vdd (1.8v core supply) supply monitoring 6 reserved 7 vss (0v) calibration 8 vref 8 calibration 9 adc0?adc1 4?5 differential 10 adc2?adc3 6?7 differential 4 .com u datasheet
functional description?application modules SN250 110/130 to ensure the pipelined digital filter in the adc is flushed, adc_en should be cleared before changes are made to adc_sel or adc_rate . discard the first sample after adc_en is set. the adc uses an internal reference, vref, which may be routed out to the alternate pin function of gpio8, vref_out. vref_out is only enabled when the adc_en bit in the adc_cfg register is set. vref is trimmed as close to 1.2v as possible by the znet software, using the regulated supply (vdd) as reference. vref is able to source modest current (see table 36 ) and is stable under capacitive loads. the adc cannot accept an external vref input. for selecting alternate pin functions, refer to table 17 and table 18 . while the adc module supports both single-ended and differential inputs, the adc input stage is differential. single-ended operation is provided by internally connecting one of the differential inputs to vref/2 while fully differential operation uses two external signals. the full-scale differential input range spans -vref to +vref and the single-ended input range spans 0 to vref. fully differential operation is recommended only when large common-mode signals are present. to correct differential input for offset and gain, each side of the input should be sampled individually using single-ended operation, so that they may be calibrated against vref. sampling of internal connections vss and vref allow for offset and gain calibration of the adc in applications where absolute accuracy is important. measurement of the unregulated supply vdd_pads, 2.1-3.6v pad supply, allows battery voltage to be monitored. measurement of the regulated supply vdd, 1.8v core supply, provides an accurate means of calibrating the adc as the regulator is factory trimmed. offset and gain correction using vref or vdd reduces both adc gain errors and reference errors but it is limited by the absolute accuracy of the supply. correction using vref is recommended because vref is calibrated by the znet software against vdd, which is factory trimmed. ta b le 3 5 shows the equations used. table 35. offset and gain correction calculation calculation type corrected sample absolute voltage offset corrected offset and gain corrected using vref, normalized to vref offset and gain corrected using vdd, normalized to vdd nn x n vss ? () = n n x n vss ? () 16 ? n vref n vss ? () --------------------------------------------- = v nvref () 2 16 -------------------------------- = n n x n vss ? () 16 ? 2n vdd n vss ? () ------------------------------------------------- - = v nvdd () 2 16 ---------------------------- = 4 .com u datasheet
SN250 functional description?application modules 111/130 equation notes: all n are 16-bit numbers. n x is a sampling of the desired analog source. n vss is a sampling of ground. n vref is a sampling of vref. n vdd is a sampling of the regulated supply, vdd/2. <<16 indicates a bit shift left by 16 bits. when calculating the voltage of vdd_pads (adc_sel = 4), v = (1/4) * vdd_pads when calculating the voltage of vdd (adc_sel = 5), v = (1/2) * vdd table 36 lists the specifications for the adc. table 36. adc specifications parameter min. typ. max. unit conversion time 32 4096 s vref 1.2 v vref output current 1 ma vref load capacitance 10 nf minimum input voltage 0 v maximum input voltage vdd v single-ended signal range 0 vref v differential signal range - vref + vref v common mode range 0 vref v input referred adc offset - 10 10 mv 4 .com u datasheet
functional description?application modules SN250 112/130 7.5.1 registers adc_cfg [0x4902] adc_data [0x4900] 7.6 event manager the xap2b core supports one irq and one wake-up input; however, the SN250 contains an advanced event manager that takes irq and w ake_up signals from a variety of internal and external sources and provides them to the xap2b. the event manager allows for each event to be separately masked and cleared by the cpu, and ensures that all events are serviced properly and promptly. event sources include: timer events gpio events sc1 and sc2 events adc system-mode sources (mac, watchdog, etc.) 15 0-r 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw 0 adc_rate adc_sel 0 0 0 0 0 0 adc_dith adc_en 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-rw 1 0-rw 0 adc_rate [14:12] adc conversion rate selection. refer to table 33 for details. adc_sel [11:8] adc input selection. refer to table 34 for details. adc_dith [1] set this bit to disable dither. adc_en [0] set this bit to enable the adc. 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r adc_data adc_data 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-r 0 adc_data [15:0] adc sample value. refer to table 33 and table 35 for details. 4 .com u datasheet
SN250 functional description?application modules 113/130 all interrupt source signals (except level-triggered gpio interrupt signals) are momentary pulses that are guaranteed to be a single cycle of the main 12mhz clock. they will synchronously set the corresponding interrupt source bit(s) within a set of hierarchically organized interrupt source register(s). the interrupt controller merges these hierarchical interrupt sources into the single interrupt input to the cpu. ta b le 3 7 illustrates the enable and configuration status of each event within the SN250. the hierarchy has two levels of interrupt source and associated mask registers for fine control of interrupt processing. the top-level int_flag and int_cfg registers have one bit per major functional module of the SN250. the second level is a set of int_periphflag and int_periphcfg registers that each have one bit per sub-function within their respective module. some modules, like adc, have no second level. for a top- level event to actually interrupt the cpu, it must be enabled in the top-level int_cfg register. second-level events must additionally be enabled in their respective second-level int_periphcfg registers. to clear (acknowledge) an interrupt, software must write a 1 into the corresponding bit of the interrupt?s lowest level int_periphflag register. for example, to acknowledge an adc interrupt, which has no second level, software must write a 1 into the int_adc bit of the top- level int_flag register. to acknowledge a sc1 rxvalid second-level interrupt, software must write a 1 into the int_scrxval bit of the second-level int_sc1flag register. if there were other enabled sc1 interrupts pending, the top-level int_sc1 bit in the int_flag register would remain set, representing the ?or? of all second-level-enabled sc1 interrupt events. the interrupt source register bits are designed to remain set if the event reoccurs at the same moment the bit is being cleared to acknowledge a prior occurrence. if another enabled interrupt of the same type occurs before being acknowledged by the software isr, it will be lost because no counting or queuing is used. however, this condition is detected and stored in the top-level int_miss register to facilitate software detection of such problems. the int_miss register is ?acknowledged? in the same way as the int_flag register?by writing a 1 into the corresponding bit to be cleared. if another enabled interrupt occurs after being acknowledged but while interrupts remain disabled, the cpu will be re-interrupted to service it when the software isr returns and interrupts are re-enabled. applications only have write access to certain bits in the top-level int_flag , int_cfg , and int_miss registers that pertain to application peripherals. they have full access to second-level int_periphflag and int_periphcfg registers for application peripherals. system peripheral events and masking are protected from application interference. applications can also trigger a software interrupt by writing into the int_swctrl register. system software is responsible for processing and acknowledging this interrupt. the SN250 also provides a global int_en enable bit to enable or disable all interrupts into the cpu. this bit can be used to easily protect brief critical sections in application or system software. table 37. event enable and configuration status event configuration interrupt pin to cpu int_en top: int_flag int_cfg 2 nd : int_periphflag int_periphcfg 4 .com u datasheet
functional description?application modules SN250 114/130 7.6.1 registers int_en [0x4618] int_cfg [0x461a] 15 0-r 14 0-r 13 0-r 12 0-r 11 0-r 10 0-r 9 0-r 8 0-r 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0int_en 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-r 2 0-r 1 0-rw 0 int_en [0] irq enable to cpu. 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw int_wdog int_fault int_tmr int_gpio int_adc int_macrx int_mactx int_ mactmr int_sec int_sc2 int_sc1 int_sleep int_bb int_sif int_sw 0 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-r 0 int_wdog [15] watchdog low watermark interrupt enable. write is ignored in application mode. int_fault [14] memory protection fault interrupt enable. write is ignored in application mode. int_tmr [13] timer interrupt enable. int_gpio [12] gpio interrupt enable. int_adc [11] adc interrupt enable. int_macrx [10] mac receive interrupt enable. write is ignored in application mode. int_mactx [9] mac transmit interrupt enable. write is ignored in application mode. int_mactmr [8] mac timer interrupt enable. write is ignored in application mode. int_sec [7] security interrupt enable. write is ignored in application mode. int_sc2 [6] sc2 interrupt enable. int_sc1 [5] sc1 interrupt enable. int_sleep [4] sleep timer interrupt enable. write is ignored in application mode. int_bb [3] baseband interrupt enable. write is ignored in application mode. int_sif [2] sif interrupt enable. write is ignored in application mode. int_sw [1] software interrupt enable. write is ignored in application mode. 4 .com u datasheet
SN250 functional description?application modules 115/130 int_flag [0x4600] 15 0-rw 14 0-rw 13 0-r 12 0-r 11 0-rw 10 0-r 9 0-r 8 0-r int_wdog int_fault int_tmr int_gpio int_adc int_macrx int_mactx int_ mactmr int_sec int_sc2 int_sc1 int_sleep int_bb int_sif int_sw 0 0-r 7 0-r 6 0-r 5 0-r 4 0-r 3 0-rw 2 0-rw 1 0-r 0 int_wdog [15] watchdog low watermark interrupt pending. write is ignored in application mode. int_fault [14] memory protection fault interrupt pending. write is ignored in application mode. int_tmr [13] timer interrupt pending. int_gpio [12] gpio interrupt pending. int_adc [11] adc interrupt pending. int_macrx [10] mac receive interrupt pending. write is ignored in application mode. int_mactx [9] mac transmit interrupt pending. write is ignored in application mode. int_mactmr [8] mac timer interrupt pending. write is ignored in application mode. int_sec [7] security interrupt pending. write is ignored in application mode. int_sc2 [6] sc2 interrupt pending. int_sc1 [5] sc1 interrupt pending. int_sleep [4] sleep timer interrupt pending. write is ignored in application mode. int_bb [3] baseband interrupt pending. write is ignored in application mode. int_sif [2] sif interrupt pending. write is ignored in application mode. int_sw [1] software interrupt pending. write is ignored in application mode. 4 .com u datasheet
functional description?application modules SN250 116/130 int_miss [0x4602] int_swctrl [0x4638] 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw int_wdog int_fault int_tmr int_gpio int_adc int_macrx int_mactx int_ mactmr int_sec int_sc2 int_sc1 int_sleep int_bb int_sif int_sw 0 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-r 0 int_wdog [15] watchdog low watermark interrupt miss. write is ignored in application mode. int_fault [14] memory protection fault miss. write is ignored in application mode. int_tmr [13] timer interrupt miss. int_gpio [12] gpio interrupt miss. int_adc [11] adc interrupt miss. int_macrx [10] mac receive interrupt miss. write is ignored in application mode. int_mactx [9] mac transmit interrupt miss. write is ignored in application mode. int_mactmr [8] mac timer interrupt miss. write is ignored in application mode. int_sec [7] security interrupt miss. write is ignored in application mode. int_sc2 [6] sc2 interrupt miss. int_sc1 [5] sc1 interrupt miss. int_sleep [4] sleep timer interrupt miss. write is ignored in application mode. int_bb [3] baseband interrupt miss. write is ignored in application mode. int_sif [2] sif interrupt miss. write is ignored in application mode. int_sw [1] software interrupt miss. write is ignored in application mode. 15 0-rw 14 0-rw 13 0-rw 12 0-rw 11 0-rw 10 0-rw 9 0-rw 8 0-rw int_swctrl int_swctrl 0-rw 7 0-rw 6 0-rw 5 0-rw 4 0-rw 3 0-rw 2 0-rw 1 0-rw 0 int_swctrl [15:0] writing to this register generates software interrupt. possible values to be written are explained and controlled in the znet software stack. 4 .com u datasheet
SN250 functional description?application modules 117/130 7.7 integrated voltage regulator the SN250 integrates a low dropout regulator to provide an accurate core voltage at a low quiescent current. table 38 lists the specifications for the integrated voltage regulator. with the regulator enabled, the pads supply voltage vdd_pads is stepped down to the 1.8v regulator output vreg_out. the vreg_out signal must be externally decoupled and routed to the 1.8v core supply pins vdd_24mhz, vdd_vco, vdd_rf, vdd_if, vdd_pre, vdd_synth, vdd_padsa, vdd_core, and vdd_flash. in addition, the regulator can be operated with several configurations of external load capacitors and decoupling capacitors. the SN250 reference design details the different configurations recommended by st. instead of using the internal regulator, an external regulator may be used. during deep sleep this external regulator can be disabled from the SN250 with the open collector reg_en signal driving low. an external pull-up is required to release this signal to indicate that 1.8v core supply should be provided. the reg_en signal is available as an alternate function on gpio pins. for selecting alternate pin-functions, refer to table 17 . table 38. integrated voltage regulator specifications spec point min. typ. max. units comments supply range for regulator 2.1 3.6 v vdd_pads regulated output 1.7 1.8 1.9 v psrr ? 40 db @100khz supplied current 0 50 ma current 200 a no load current (bandgap, regulator, feedback) quiescent current 10 na 4 .com u datasheet
sif module programming and debug interface SN250 118/130 8 sif module programming and debug interface sif is a synchronous serial interface developed by cambridge consultants ltd. it is the primary programming and debug interface of the SN250. therefore, any design implementing the SN250 should make the sif signals readily available. the sif module allows external devices to read and write memory-mapped registers in real-time without changing the functionality or timing of the xap2b core. see the SN250 reference design for details regarding the implementation of the sif interface. the sif interface provides the following: ic production test (especially analog) pcb production test xap2b code development product control and characterization the pins are: sif_loadb sif_clk sif_mosi sif_miso because the sif module directly connects to the program and data memory buses within the SN250, it has access to the entire fl ash and ram blocks, as well as the on-chip registers. the maximum serial shift speed for the sif interface is 48mhz. sif interface accesses can be initiated even when the chip is in idle and deep sleep modes. an edge on sif_loadb wakes the chip to allow sif cycles. 4 .com u datasheet
SN250 typical application 119/130 9 typical application figure 16 illustrates the typical application circuit for the SN250. this figure does not contain all decoupling capacitance required by the SN250. the balun provides the impedance transformation from the antenna to the SN250 for both tx and rx modes. the 24mhz crystal with loading capacitors is required and provides the high frequency source for the SN250. the 32.768khz crystal generates the clock source for the sleep timer, but it is not mandatory as the internal rc oscillator can be used. figure 16. typical application circuit table 39 contains the bill of materials for the application circuit shown in figure 16 . 4 .com u datasheet
typical application SN250 120/130 table 39. bill of materials item quantity reference description manufacturer 1 1 c2 capacitor, 5 pf, 50 v, npo, 0402 2 2 c1,c3 capacitor, 0.5 pf, 50 v, npo, 0402 3 4 c4,c5,c6,c7 capacitor, 22 pf, 50 v, npo, 0402 41 c8 capacitor, 10 f, 10 v, tantalum, 3216 (size a) 5 2 l1,l2 inductor, 6.8 nh, 5%, 0402 murata lqg15hs6n8s02d 6 1 l3 inductor, 5.6 nh, 5%, 0402 murata lqg15hs5n6s02d 7 1 r1 resistor, 169 k , 1%, 0402 81 u1 SN250 single-chip zigbee/802.15.4 solution stmicroelectronics SN250 91 x1 crystal, 24.000 mhz, 10ppm tolerance, 25ppm stability, 18 pf, ? 40 to + 85c ilsi ilcx08-jg5f18- 24.000mhz 10 1 x2 (optional) crystal, 32.768 khz, 20ppm tolerance, 12.5 pf, ? 40 to + 85c ilsi il3x-hx5-12.5- 32.768 khz 4 .com u datasheet
SN250 mechanical data 121/130 10 mechanical data the SN250 package is a plastic 48-pin qfn that is 7mm x 7mm x 0.9mm. a large ground pad in the bottom center of the package forms a 49th pin. a number of thermal vias should connect the SN250 decal center to a pcb ground plane. for more information, refer to the SN250 reference design . figure 17 illustrates the package drawing. figure 17. package drawing 4 .com u datasheet
register address table SN250 122/130 11 register address table table 40 provides the address, reset value, and description of the registers in the SN250. these registers are accessible by the application (user). table 40. register address table block: serial 4400?44b6 sc1 and sc2 control and status registers address name type reset 0x4400 sc2_rxbega rw 0x6000 rx dma start address a 0x4402 sc2_rxenda rw 0x6000 rx dma end address a 0x4404 sc2_rxbegb rw 0x6000 rx dma start address b 0x4406 sc2_rxendb rw 0x6000 rx dma end address b 0x4408 sc2_txbega rw 0x6000 tx dma start address a 0x440a sc2_txenda rw 0x6000 tx dma end address a 0x440c sc2_txbegb rw 0x6000 tx dma start address b 0x440e sc2_txendb rw 0x6000 tx dma end address b 0x4410 sc2_rxcnta r 0x0000 rx dma buffer a byte count 0x4412 sc2_rxcntb r 0x0000 rx dma buffer b byte count 0x4414 sc2_txcnt r 0x0000 tx dma buffer count 0x4416 sc2_dmastat r 0x0000 dma status 0x4418 sc2_dmactrl rw 0x0000 dma control 0x441a sc2_rxerra r 0x0000 rx dma buffer a first error marker 0x441c sc2_rxerrb r 0x0000 rx dma buffer b first error marker 0x441e sc2_data rw 0x0000 sc2 data 0x4420 sc2_spistat r 0x0000 sc2 spi status 0x4422 sc2_i2cstat r 0x0000 sc2 i 2 c status 0x4426 sc2_i2cctrl1 rw 0x0000 sc2 i 2 c control 1 0x4428 sc2_i2cctrl2 rw 0x0000 sc2 i 2 c control 2 0x442a sc2_mode rw 0x0000 sc2 mode control 0x442c sc2_spicfg rw 0x0000 sc2 spi control 0x4430 sc2_ratelin rw 0x0000 sc2 linear component of clock rate 0x4432 sc2_rateexp rw 0x0000 sc2 exponential component of clock rate 0x4480 sc1_rxbega rw 0x6000 rx dma start address a 0x4482 sc1_rxenda rw 0x6000 rx dma end address a 0x4484 sc1_rxbegb rw 0x6000 rx dma start address b 0x4486 sc1_rxendb rw 0x6000 rx dma end address b 4 .com u datasheet
SN250 register address table 123/130 0x4488 sc1_txbega rw 0x6000 tx dma start address a 0x448a sc1_txenda rw 0x6000 tx dma end address a 0x448c sc1_txbegb rw 0x6000 tx dma start address b 0x448e sc1_txendb rw 0x6000 tx dma end address b 0x4490 sc1_rxcnta r 0x0000 rx dma buffer a byte count 0x4492 sc1_rxcntb r 0x0000 rx dma buffer b byte count 0x4494 sc1_txcnt r 0x0000 tx dma buffercount 0x4496 sc1_dmastat r 0x0000 dma status 0x4498 sc1_dmactrl rw 0x0000 dma control 0x449a sc1_rxerra r 0x0000 rx dma buffer a first error marker 0x449c sc1_rxerrb r 0x0000 rx dma buffer b first error marker 0x449e sc1_data rw 0x0000 sc1 data 0x44a0 sc1_spistat r 0x0000 sc1 spi status 0x44a2 sc1_i2cstat r 0x0000 sc1 i 2 c status 0x44a4 sc1_uartstat r 0x0040 sc1 uart status 0x44a6 sc1_i2cctrl1 rw 0x0000 sc1 i 2 c control 1 0x44a8 sc1_i2cctrl2 rw 0x0000 sc1 i 2 c control 2 0x44aa sc1_mode rw 0x0000 sc1 mode control 0x44ac sc1_spicfg rw 0x0000 sc1 spi control 0x44ae sc1_uartcfg rw 0x0000 sc1 uart control 0x44b0 sc1_ratelin rw 0x0000 sc1 linear component of clock rate 0x44b2 sc1_rateexp rw 0x0000 sc1 exponential component of clock rate 0x44b4 sc1_uartper rw 0x0000 sc1 baud rate period 0x44b6 sc1_uartfrac rw 0x0000 sc1 baud rate fraction block: timer1 4500?4514 timer 1 control and status registers address name type reset 0x4500 tmr1_cnt rw 0x0000 timer 1 counter 0x4502 tmr1_capa r 0x0000 timer 1 capture a 0x4504 tmr1_capb r 0x0000 timer 1 capture b 0x4506 tmr1_top rw 0xffff timer 1 threshold 0x4508 tmr1_cmpa rw 0x0000 timer 1 compare a 0x450a tmr1_cmpb rw 0x0000 timer 1 compare b 0x450c tmr1_cfg rw 0x0000 timer 1 config 0x450e tmr1_cmpcfga rw 0x0000 timer 1 output a config 0x4510 tmr1_cmpcfgb rw 0x0000 timer 1 output b config table 40. register address table (continued) 4 .com u datasheet
register address table SN250 124/130 0x4512 tmr1_capcfga rw 0x0000 timer 1 input capture a config 0x4514 tmr1_capcfgb rw 0x0000 timer 1 input capture b config block: timer2 4580?4594 timer 2 control and status registers address name type reset 0x4580 tmr2_cnt rw 0x0000 timer 2 counter 0x4582 tmr2_capa r 0x0000 timer 2 capture a 0x4584 tmr2_capb r 0x0000 timer 2 capture b 0x4586 tmr2_top rw 0xffff timer 2 threshold 0x4588 tmr2_cmpa rw 0x0000 timer 2 compare a. 0x458a tmr2_cmpb rw 0x0000 timer 2 compare b 0x458c tmr2_cfg rw 0x0000 timer 2 config 0x458e tmr2_cmpcfga rw 0x0000 timer 2 output a config 0x4590 tmr2_cmpcfgb rw 0x0000 timer 2 output b config 0x4592 tmr2_capcfga rw 0x0000 timer 2 input capture a config 0x4594 tmr2_capcfgb rw 0x0000 timer 2 input capture b config block: event 4600?4638 event control and status registers address name type reset 0x4600 int_flag rw 0x0000 interrupt source 0x4602 int_miss rw 0x0000 interrupt event missed 0x460c int_sc1flag rw 0x0000 sc1 interrupt source 0x460e int_sc2flag rw 0x0000 sc2 interrupt source 0x4610 int_gpioflag rw 0x0000 gpio interrupt source 0x4614 int_tmrflag rw 0x0000 timer interrupt source 0x4618 int_en rw 0x0000 interrupt enable 0x461a int_cfg rw 0x0000 interrupt config 0x4624 int_sc1cfg rw 0x0000 sc1 interrupt config 0x4626 int_sc2cfg rw 0x0000 sc2 interrupt config 0x4628 int_gpiocfg rw 0x0000 gpio interrupt config 0x462c int_tmrcfg rw 0x0000 timer interrupt config 0x4630 gpio_intcfga rw 0x0000 gpio interrupt a config 0x4632 gpio_intcfgb rw 0x0000 gpio interrupt b config 0x4634 gpio_intcfgc rw 0x0000 gpio interrupt c config 0x4636 gpio_intcfgd rw 0x0000 gpio interrupt d config 0x4638 int_swctrl rw 0x0000 software interrupt table 40. register address table (continued) 4 .com u datasheet
SN250 register address table 125/130 block: gpio 4700?4728 general purpose io control and data address name type reset 0x4700 gpio_inh r 0x0000 gpio input data?upper bits 0x4702 gpio_inl r 0x0000 gpio input data?lower bits 0x4704 gpio_outh rw 0x0000 gpio output data?upper bits 0x4706 gpio_outl rw 0x0000 gpio output data?lower bits 0x4708 gpio_seth rw 0x0000 gpio set output data?upper bits 0x470a gpio_setl w 0x0000 gpio set output data?lower bits 0x470c gpio_clrh rw 0x0000 gpio clear output data?upper bits 0x470e gpio_clrl w 0x0000 gpio clear output data?lower bits 0x4710 gpio_dbg rw 0x0000 gpio debug 0x4712 gpio_cfg rw 0x2000 gpio config 0x4714 gpio_dirh rw 0x0000 gpio output enable?upper bits 0x4716 gpio_dirl rw 0x0000 gpio output enable?lower bits 0x4718 gpio_dirseth rw 0x0000 gpio set enable?upper bits 0x471a gpio_dirsetl w 0x0000 gpio set enable?lower bits 0x471c gpio_dirclrh rw 0x0000 gpio clear enable?upper bits 0x471e gpio_dirclrl w 0x0000 gpio clear enable?lower bits 0x4720 gpio_pdh rw 0x0000 gpio pin pull-down enable?upper bits 0x4722 gpio_pdl rw 0x0000 gpio pin pull-down enable?lower bits 0x4724 gpio_puh rw 0x0000 gpio pin pull-up enable?upper bits 0x4726 gpio_pul rw 0x0000 gpio pin pull-up enable?lower bits 0x4728 gpio_wakel rw 0x0000 gpio wakeup monitor register block: adc 4900?4902 adc control and status address name type reset 0x4900 adc_data r 0x0000 adc data 0x4902 adc_cfg rw 0x0000 adc config table 40. register address table (continued) 4 .com u datasheet
abbreviations and acronyms SN250 126/130 12 abbreviations and acronyms acr adjacent channel rejection aes advanced encryption standard cbc-mac cipher block chaining-message authentication code cca clear channel assessment ccm counter with cbc-mac mode for aes encryption ccm* improved counter with cbc-mac mode for aes encryption csma carrier sense multiple access ctr counter mode eeprom electrically erasable programmable read only memory esd electro static discharge esr equivalent series resistance ffd full function device (zigbee) fia flash information area gpio general purpose i/o (pins) hf high frequency (24mhz) i2c inter-integrated circuit bus ide integrated development environment if intermediate frequency ip3 third order intermodulation product isr interrupt service routine kb kilobyte kbps kilobits/second lf low frequency lna low noise amplifier lqi link quality indicator mac medium access control msl moisture sensitivity level msps mega samples per second o-qpsk offset-quadrature phase shift keying pa power amplifier per packet error rate phy physical layer pll phase-locked loop por power-on-reset 4 .com u datasheet
SN250 abbreviations and acronyms 127/130 psd power spectral density psrr power supply rejection ratio pti packet trace interface pwm pulse width modulation rohs restriction of hazardous substances rssi receive signal strength indicator sfd start frame delimiter sif serial interface spi serial peripheral interface uart universal asynchronous receiver/transmitter vco voltage controlled oscillator vdd voltage supply 4 .com u datasheet
references SN250 128/130 13 references 1 ieee 802.15.4-2003 ( http://standards.ieee.org/getieee802/download/802.15.4-2003.pdf ) 2 ieee 802.11g ( http://standards.ieee.org/getieee802/download/802.11g-2003.pdf ) 3 bluetooth specification v1.2 ( www.bluetooth.org/spec ) 4 zigbee specification v1.1 ( www.zigbee.org ; document number 053474r07) 5 zigbee security services specification v1.0 (document number 03322r13) 6st SN250 reference design ( www.st.com ) 4 .com u datasheet
SN250 revision history 129/130 14 revision history table 41. document revision history date revision changes 24-april-2006 1 initial release. 4 .com u datasheet
SN250 130/10 please read carefully: information in this document is provided solely in connection with st products. stmicroelectronics nv and its subsidiaries (?st ?) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described he rein at an y time, without notice. all st products are sold pursuant to st?s terms and conditions of sale. purchasers are solely responsible for the choice, selection and use of the st products and services described herein, and st as sumes no liability whatsoever relating to the choice, selection or use of the st products and services described herein. no license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. i f any part of this document refers to any third party products or services it shall not be deemed a license grant by st for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoev er of such third party products or services or any intellectual property contained therein. unless otherwise set forth in st?s terms and conditions of sale st disclaims any express or implied warranty with respect to the use and/or sale of st products including without limitation implied warranties of merchantability, fitness for a particular purpose (and their equivalents under the laws of any jurisdiction), or infringement of any patent, copyright or other intellectual property right. unless expressly approved in writing by an authorize representative of st, st products are not designed, authorized or warranted for use in military, air craft, space, life saving, or life sustaining applications, nor in products or systems, where failure or malfunction may result in personal injury, death, or severe property or environmental damage. resale of st products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by st for the st product or service described herein and shall not create or extend in any manner whatsoev er, any liability of st. st and the st logo are trademarks or registered trademarks of st in various countries. information in this document supersedes and replaces all information previously supplied. the st logo is a registered trademark of stmicroelectronics. all other names are the property of their respective owners. ? 2006 stmicroelectronics - all rights reserved stmicroelectronics group of companies australia - belgium - brazil - canada - china - czech republic - finland - france - germany - hong kong - india - israel - ital y - japan - malaysia - malta - morocco - singapore - spain - sweden - switzerland - united kingdom - united states of america www.st.com 4 .com u datasheet


▲Up To Search▲   

 
Price & Availability of SN250

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X